2015年1月11日 星期日

Laravel 串 js and html5 html file

 首先 將所有的資源檔案放入 Laravel框架下的對應位置

  • /public/css/app.css
  • /public/js/app.js
  • /public/index.html
範例 我放了 public/john/index.html

接著回到app資料夾下 找到 routes.php 這檔案

加入以下的規則

Route::get('john',function())
{
    return File::get(public_path().'john/index.html');
});



這樣導入後
只要在網址列後面接 cpc-cpcteam.rhcloud.com/john 就會出現html file的網頁了!!! 也可以正常的使用js

0 意見:

張貼留言