THIS IS A QUESTION FOR LARAVEL 3
Given the following route
Route::get('groups/(:any)', array('as' => 'group', 'uses' => 'groups@show'));
And the URL I would like to use,
http://www.example.com/groups/1
我希望能够使用控制器中的(:any)
值.
我的控制器看起来像
class Groups_Controller extends Base_Controller {
public $restful = true;
public function get_show($groupID) {
return 'I am group id ' . $groupID;
}
}
How is this possible to do? I have tried a few things including the following
Route::get('groups/(:any)', array('as' => 'group', 'uses' => 'groups@show((:1))'));
但它没有起作用.
UPDATE
Anytime I try to pass in the arguments as show above i get a 404 error.
谢谢你的帮助!