【发布时间】:2014-10-14 01:00:11
【问题描述】:
我必须从视图文件链接到路线,但它不起作用。 错误是:找不到页面
{{ URL::route('routename') }}
但是当我尝试通过 localhost/laravel/index.php/routename 访问它时 然后我可以访问该文件。 我已经做好了 全部覆盖所有
在 httpd 中也取消注释这一行 LoadModule rewrite_module modules/mod_rewrite.so
【问题讨论】:
我必须从视图文件链接到路线,但它不起作用。 错误是:找不到页面
{{ URL::route('routename') }}
但是当我尝试通过 localhost/laravel/index.php/routename 访问它时 然后我可以访问该文件。 我已经做好了 全部覆盖所有
在 httpd 中也取消注释这一行 LoadModule rewrite_module modules/mod_rewrite.so
【问题讨论】:
你需要在 C:\wamp\bin\apache\apache2.2.22\conf\httpd 中做两件事 1)取消注释该行 LoadModule setenvif_module 模块/mod_setenvif.so 2)将 AllOverride none 更改为 AllOverride All
我缺少的是刀片模板系统.. 使用 Blade.php 扩展名重命名视图文件
【讨论】:
你需要命名你的路线
Route::get('user/profile', array(
'as' => 'profile', // This is the route's name
'uses' => 'UserController@showProfile'
));
现在你可以调用 {{URL::route('profile')}}
【讨论】: