编辑|我尝试用“Web”为控制器类名添加前缀 - 没有骰子:(
根据我所阅读和以前经历的所有内容:
http://symfony.com/doc/current/best_practices/controllers.html
我应该能够将控制器移动/组织到子文件夹中,但现在我似乎无法让Symfony合作:
AppBundle/Controller
- MemberController.php
- DefaultController.php
工作正常 - 但如果我搬家
AppBundle/Controller
/web/MemberController
- DefaultController
然后清除缓存 - 我收到以下错误:
[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
当然不是我把它从一个目录下移到子文件夹“web”中。是什么赋予了?我的routing.yml就像:
一样简单site:
resource: "@AppBundle/Controller"
type: annotation