2016-11-10 6 views
0

Ich habe 2 Admin-Listen mit kunstmaan/adminlist-bundle erstellt und festgestellt, dass das in routing.yml angegebene Präfix nicht erkannt wird.symfont route prefix funktioniert nicht

MyBundle/Ressource/config/routing.yml

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/ 

Allerdings, wenn ich bin/console debug ausführen: Router I

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 

bekommen Wie kann ich diese Wege haben ihre Präfixe angewandt?

Antwort

0

Das kunstmaan-Paket erstellt diese Präfixe in AppBundle/Resources/routing.yml, aber sie funktionieren nicht, da das Routing in Annotationen erfolgt und nicht zwischen yaml und Annotation gemischt werden kann.

So ist die Lösung fand ich ist, sie von routing.yml

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

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

zu entfernen und sie zu den Controller-Klassen hinzuzufügen:

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

class ImportErrorAdminListController extends AdminListController