Custom Controller Directory Structure Symfony2

前端 未结 2 921
长情又很酷
长情又很酷 2021-01-23 10:10

I\'m transitioning a Kohana application to Symfony2. In Kohana I had to register a custom autoloader to make the framework see my controllers given my preferred directory struct

2条回答
  •  囚心锁ツ
    2021-01-23 11:06

    You can place your controllers wherever you want, just import them in your routing.yml:

    controller:
        resource: @MyBundle/Theme/Frontend/Controller/
        type: annotation
    

    Of course, this is only an example. You can find more information and plenty of examples on routing here: http://symfony.com/doc/current/book/routing.html

提交回复
热议问题