我有问题
数组到字符串转换
vendor / laravel / framework / src / Illuminate / Routing / Router.php第976行(命名空间)
protected function prependGroupUses($uses)
{
$group = last($this->groupStack);
return isset($group['namespace']) ? $group['namespace'].'\\'.$uses : $uses;
}
我的路线.php
Route::group(array('domain' => 'subdomain.abc.com','prefix' => 'admin','namespace' => 'Admin\Controllers'), function() {
# User Management
Route::get('users/{id}/edit', array('as'=>'users.edit','uses' => 'UsersController@getEdit'));
Route::post('users/{id}/edit', array('as'=>'users.edit','uses' => 'UsersController@postEdit'));
#Route::get('users/{id}/delete', array('as'=>'users.delete')'UsersController@getDelete');
Route::post('users/{id}/delete', array('as'=>'users.delete','uses' => 'UsersController@postDelete'));
Route::controller('users', array('as'=>'users','uses' => 'UsersController'));
# Group Management
Route::get('groups/{id}/edit', array('as'=>'groups.edit','uses' => 'GroupsController@getEdit'));
Route::post('groups/{id}/edit', array('as'=>'groups.edit','uses' => 'GroupsController@postEdit'));
Route::post('groups/{id}/delete', array('as'=>'groups.delete','uses' => 'GroupsController@postDelete'));
Route::controller('groups', array('as'=>'groups','uses' => 'GroupsController'));
});
答案 0 :(得分:2)
Route::controller
需要3个参数。
public function controller($uri, $controller, $names = array())
因此,您当前正在将数组传递给第二个参数而不是字符串。
<强>参考强>