【发布时间】:2014-07-13 23:58:14
【问题描述】:
好的,所以我刚刚开始检查 Laravel 4.1,我遇到了一个问题,我不明白为什么?问题是我在屏幕上收到这条消息“哎呀,好像出了点问题。”但我真的什么都没做。我创建了一个视图、一个控制器并添加了一个路由,这就是这些文件中的内容
查看
<h1>Author's home page</h1>
控制器
class AuthorsController extends BaseController {
public $restful = true;
public function getIndex () {
return View::make('authors.index'); //authors.index because it's in the authors folder within the views folder
}
}
和路线
Route::get('authors', 'AuthorsController@getIndex');
所以逻辑表明,当我转到作者 URL 时,它应该在 AurhorsController 页面中加载 getIndex 函数并显示位于视图 > authors 中的 index.blade.php 文件。
如果是这样,那么我不知道为什么这不起作用!任何帮助,将不胜感激。提前致谢。
编辑 1
这是实际错误
throw new NotFoundHttpException();
编辑 2
【问题讨论】:
-
"Whoops, looks like something went wrong."是显示在所有错误页面上的通用文本。您能否粘贴实际的错误消息(查找异常)? -
@MarttiLaine 我关闭了调试,哎呀这是错误... throw new NotFoundHttpException();
标签: php laravel laravel-4 url-routing