2014-10-10 43 views
1

我是Laravel的新手。正如我在标题中提到的那样,Laravel中是否有像AngularJS(否则)那样的路由声明?例如,我将定义一些路由,并将所有其他URI请求重定向到某个页面/索引页面/错误页面?是否有Laravel路线链接Angularjs /否?

回答

0

你显然没有尝试Google:laravel routes

http://laravel.com/docs/4.2/routing

+0

对不起,仍然找不到那样的人。你能提一下吗? – 2014-10-10 14:32:31

+0

我真的不明白......你在寻找一个全面的? – 2014-10-10 14:42:30

2

你的问题有点不清楚,但它听起来像你正在寻找一个包罗万象的路线。

根据Laravel Snippets sites,如果将以下内容添加到app/routes.php的末尾,这应该会给你想要的。

Route::get('{slug?}', function(){ 
    return 'Catch All'; 
})->where('slug', '.+'); 
0

在你Laravel应用,定位于APP/routes.php文件

这就是你的路由都将保留。你可以像这样定义它们:

Route::get('/home', function() { 
    return View::make('pages.home'); 
}); 

,或呼叫控制器:

Route::get('/home', ['uses' => '[email protected]']); 

你可以叫HTTP动词,以及像这样:

Route::post('/some/form', ['uses' => '[email protected]']); 

请在这里看到更多的info:http://laravel.com/docs/4.2/routing