Named restful routes in Laravel 4

前端 未结 3 1239
情话喂你
情话喂你 2021-02-03 15:45

So, I\'ve been able to get restful controllers working with

Route::controller(\'users\',\'UserController\');

class UserController extends BaseController {
    p         


        
3条回答
  •  后悔当初
    2021-02-03 16:19

    Try this:

    Route::get('/',array('as'=>'named_route','uses'=>'yourRestfulController@getMethod'));
    

    This works nice for me. The trick was adding the action type after @ part. You should use the full name of the method unlike in L3.

提交回复
热议问题