laravel 5.2 RouteCollection.php第161行中的NotFoundHttpException:

时间:2016-07-11 06:39:27

标签: laravel laravel-5.2

源代码 我使用的链接是nav.blade.php:

{{link_to_route('register','Sign Up',null,['class'=>'signup-btn tbutton small'])}}

和routes.php

Route::get('create',[
    'as'=>'register',
    'uses'=>'RegistrationController@create'
]);

错误:

抱歉,找不到您要查找的页面。

1/1
NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 821
at Router->findRoute(object(Request)) in Router.php line 691
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 54

感谢

1 个答案:

答案 0 :(得分:0)

link_to_route期待“路线名称”,例如register.createregister.show。取决于你的路线。

如果网址使用hello/world之类的URI,则可以使用link_to