我试图改变我的路由从注释到thr routing.yml。 这是现在在我的routing_dev.yml的唯一配置:symfony2路由失败 - 无法重新声明类
user.index:
pattern:/
defaults: { _controller: AcmeMyBundle:User/UserIndex:index }
这是错误:
Fatal error: Cannot redeclare class Acme\MyBundle\Controller\User\UserIndexController in C:\Users\gp\Desktop\xampp\htdocs\project\src\Acme\MyBundle\Controller\User\UserIndexController.php on line 56
它为什么会发生?这真的是唯一有这个名字的班级。我在UserIndexController中没有注释。
有没有人有想法? 非常感谢。
我相信你认为这是唯一一个拥有这个名字的类,但是PHP因为这个错误而失败,原因是:)不,它不是路由相关的。另外你的_controller配置看起来很奇怪“IdiotsP1Bundle:User/UserIndex:index” - 这真的有用吗?与斜线之间? – Inoryy 2012-02-01 13:26:44
userindexController位于文件夹Controller/User/UseriIndexcontroller.php当我认为用户/然后路由找不到类 – 2012-02-01 14:15:20