我现在想要的只是使用一个 Controller 来处理进入我的 laravel 4 应用程序的每个请求。问题是 stackoverflow 或其他地方的解决方案都不适合我。
这就是我目前拥有的:
Route::any('(.*)', function(){
return View::make('hello');
});
现在,当浏览到该页面时,我每次都会收到一条错误消息:
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
希望有人能帮帮我!
最佳答案
正则表达式是作为需求设置的,并没有直接在路由中设置。
Route::any('{all}', function($uri)
{
return View::make('hello');
})->where('all', '.*');
关于php - 获取所有路由,Laravel 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16178426/