i’m trying to change my routing from annotations to thr routing.yml.
This is now the only configuration in my routing_dev.yml:
user.index:
pattern: /
defaults: { _controller: AcmeMyBundle:User/UserIndex:index }
And this is the error:
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
Why does it happen? This is really the only class with this name. I have no annotations in the UserIndexController.
Has anybody an idea?
Thank you very much.
Try to grep/find in your project for
Acme\MyBundle\Controller\User\UserIndexController.You maybe really have the class declared twice.
Then, try to replace
with
AcmeMyBundle:User\\UserIndex:indexDepending of the version of symfony, it will search for a “namespace like” and/or a “path like”.