Sonata Admin Bundle 2个1实体的管理页面

时间:2012-06-13 12:39:29

标签: symfony symfony-sonata

我正在尝试为1个实体创建2个管理页面,但模式是相同的:

php app / console route:debug

dis_codes_companies_list              ANY      /admin/mobispot/discodes/discode/list
dis_codes_companies_create            ANY      /admin/mobispot/discodes/discode/create
dis_codes_companies_batch             ANY      /admin/mobispot/discodes/discode/batch
dis_codes_companies_edit              ANY      /admin/mobispot/discodes/discode/{id}/edit
dis_codes_companies_delete            ANY      /admin/mobispot/discodes/discode/{id}/delete
dis_codes_companies_show              ANY      /admin/mobispot/discodes/discode/{id}/show
dis_codes_companies_export            ANY      /admin/mobispot/discodes/discode/export
dis_codes_companies_set_premium       ANY      /admin/mobispot/discodes/discode/{id}/setpremium
dis_codes_personal_list               ANY      /admin/mobispot/discodes/discode/list
dis_codes_personal_create             ANY      /admin/mobispot/discodes/discode/create
dis_codes_personal_batch              ANY      /admin/mobispot/discodes/discode/batch
dis_codes_personal_edit               ANY      /admin/mobispot/discodes/discode/{id}/edit
dis_codes_personal_delete             ANY      /admin/mobispot/discodes/discode/{id}/delete
dis_codes_personal_show               ANY      /admin/mobispot/discodes/discode/{id}/show
dis_codes_personal_export             ANY      /admin/mobispot/discodes/discode/export
dis_codes_personal_set_premium        ANY      /admin/mobispot/discodes/discode/{id}/setpremium

我可以在哪里改变路线模式?如果我在RouteCollection类中这样做,我有一个错误:

No route found for "GET /admin/mobispot/discodes/personal/list"

1 个答案:

答案 0 :(得分:0)

您可以在configureRoutes方法

中更改AdminClass中的路由
protected function configureRoutes(RouteCollection $router) {
    $router->add('copy', $this->getRouterIdParameter() . '/copy');
    $router->add('getSubProjects', $this->getRouterIdParameter() . '/getSubProjects');
}