2016-11-10 3 views
0

kunstmaan/adminlist-bundle을 사용하여 2 개의 관리 목록을 생성했으며 routing.yml에 지정된 접두사가 인식되지 않습니다.symfont route prefix가 작동하지 않습니다.

MyBundle/자원/설정/내가 빈/콘솔 디버그를 실행할 때

appbundle_importerror_admin_list: 
    resource: @AppBundle/Controller/ImportErrorAdminListController.php 
    type:  annotation 
    prefix: /admin/importerror 

appbundle_filetosync_admin_list: 
    resource: @AppBundle/Controller/FileToSyncAdminListController.php 
    type:  annotation 
    prefix: /admin/filetosync/ 

그러나 routing.yml : 라우터를 내가이 노선들은 접두사 적용한 가질 수있는 방법

homepage        ANY  ANY  ANY /         
appbundle_admin_filetosync    ANY  ANY  ANY /         
appbundle_admin_filetosync_add   GET|POST ANY  ANY /add        
appbundle_admin_filetosync_edit   GET|POST ANY  ANY /{id}        
appbundle_admin_filetosync_view   GET  ANY  ANY /{id}        
appbundle_admin_filetosync_delete  GET|POST ANY  ANY /{id}/delete      
appbundle_admin_filetosync_export  GET|POST ANY  ANY /export.{_format}     
appbundle_admin_filetosync_move_up  GET  ANY  ANY /{id}/move-up      
appbundle_admin_filetosync_move_down GET  ANY  ANY /{id}/move-down      
appbundle_admin_importerror    ANY  ANY  ANY /         
appbundle_admin_importerror_add   GET|POST ANY  ANY /add        
appbundle_admin_importerror_edit  GET|POST ANY  ANY /{id}        
appbundle_admin_importerror_view  GET  ANY  ANY /{id}        
appbundle_admin_importerror_delete  GET|POST ANY  ANY /{id}/delete      
appbundle_admin_importerror_export  GET|POST ANY  ANY /export.{_format}     
appbundle_admin_importerror_move_up  GET  ANY  ANY /{id}/move-up      
appbundle_admin_importerror_move_down GET  ANY  ANY /{id}/move-down 

를 얻을?

답변

0

kunstmaan 번들은 이러한 접두어를 AppBundle/Resources/routing.yml에 생성하지만 라우팅이 주석으로 이루어지기 때문에 작동하지 않으며 yaml과 주석간에 혼합 할 수 없습니다.

/** 
* The admin list controller for ImportError 
* 
* @Route("/admin/importerror") 
*/ 

class ImportErrorAdminListController extends AdminListController 
:

그래서 내가 찾은 해결책은 routing.yml

appbundle_importerror_admin_list: 
    resource: @AppBundle/Controller/ImportErrorAdminListController.php 
    type:  annotation 

appbundle_filetosync_admin_list: 
    resource: @AppBundle/Controller/FileToSyncAdminListController.php 
    type:  annotation 

에서 제거하고 컨트롤러 클래스에 추가하는 것입니다