【发布时间】:2014-11-13 11:24:34
【问题描述】:
我的 localhost 使用 laravel 路由打开我的视图,它的工作原理:
http://localhost/view/stock/equipment
返回我的视图的 Laravel 4 路线:
Route::get('view/stock/equipment', array('uses'=>'App\Controllers\Stock\EquipmentController@getIndex'));
我的观点包含:
{{ HTML::script('js-views/stock/equipment/bootstrap.js') }}
在我的 html 页面中显示为:
<script src="http://localhost/js-views/stock/equipment/bootstrap.js"></script>
但是 bootstrap.js 不会加载,当我查看使用 firebug 时,我发现它没有从正确的路径加载:
GET http://localhost/view/stock/bootstrap.js 404 Not Found
我可以看到来自 laravel 路线的“视图/库存部分”。
在 Laravel 中正确设置了公共路径。
这怎么可能?
【问题讨论】:
-
我注意到 GET 404 not found 是从 bootstrap.js 中调用的 - 所以我想我应该检查 bootstrap.js。
标签: javascript laravel-4 loading assets laravel-routing