我想将Laravel 4.2分页自定义为:
旧:
www.domain.com/lorem-ipsum?page=2
新:
www.domain.com/lorem-ipsum-page2
可以这样做吗?
答案 0 :(得分:1)
是的,您必须在路线定义中指定它:
旧:
Route::get('lorem-ipsum', function() {
$page = Input::get['page'];
});
要:
Route::get('lorem-ipsum-page{page}', function($page) {
// now page is as a parameter of this function, it is not necessary to get it from Input
});