Symfony 3.2.1 - bundle controllers in sub-directories

320 views Asked by At

EDIT | I tried prefixing controllers class name with "Web" - no dice :(

According to everything I have read and previously experienced:

http://symfony.com/doc/current/best_practices/controllers.html

I should be able to move/organize controllers into sub-folders but now I cannot seem to get Symfony to cooperate:

AppBundle/Controller
  - MemberController.php
  - DefaultController.php

Works fine - but if I move

AppBundle/Controller
  /web/MemberController
  - DefaultController

Then clear the cache - I get the following error(s):

  [Symfony\Component\Config\Exception\FileLoaderLoadException]                                                                                                                       
  Class AppBundle\Controller\MemberController does not exist in /var/www/project/src/AppBundle/Controller (which is being imported from "/var/www/project/app/config/routing.yml").  

  [ReflectionException]                                       
  Class AppBundle\Controller\MemberController does not exist 

Of course it doesn't I moved it up down one directory into a sub-folder "web". What gives? My routing.yml is as simple as:

site:
    resource: "@AppBundle/Controller"
    type:     annotation
0

There are 0 answers