1

路线:

Route::controller('account/pages','PagesController' );
Route::controller('account','AccountController' );    
Route::get('/', function() {
    return Redirect::to('account');
});

页面控制器:

public function getGerente()
{
    return Redirect::action('GerenteController@getIndex');
}

Gerente控制器:

public function getIndex()
{
    return View::make('account/gerente/index');
}

看法:

<a href="{{ URL::action('PagesController@getGerente') }}">Gerente</a>

但是当点击时,返回“Unknown action [GerenteController@getIndex]”,我该如何解决这个问题?

4

1 回答 1

1

由于您尚未为 GerenteController 定义路由,因此 URL::action 命令不知道该做什么。修理:

//add to your routes file
Route::controller('gerente', 'GerenteController');
于 2013-08-04T12:08:45.133 回答