0
我是Laravel的新手,我遇到了一些問題。當我試圖訪問像[域名]/user/1這樣的URL時,NotFoundHttpException即將出現。從我一直在研究的內容來看,這顯然意味着找不到路由。雖然我的代碼看不到任何錯誤,但看起來應該找到路由。Laravel的NotFoundHttpException
的路線:
Route::get('user/(:any)', array('as' => 'user', 'uses' => '[email protected]'));
控制器:
public function getView($id) {
return View::make('users.view',
[
'title' => 'User View Page',
'user' => User::find($id)
]
);
}
的觀點:
@extends('layouts.master')
@section('content')
<h1>{{ $user -> user }}</h1>
<p>{{ $user -> bio }}</p>
@stop
我有mod_rewrite的。 這條路線爲什麼找不到視圖?
完美的作品現在..這是使用過時的資源我想這個問題。非常感謝。看起來這是我應該使用的資源http://wiki.laravel.io/Changelog_(Laravel_4) – 2014-09-12 21:02:32
實際上,不,你應該總是參考文檔:http://laravel.com/docs – 2014-09-12 21:24:02