Symfony 2: route defined in annotation not visible from by Twig's path() Symfony 2: route defined in annotation not visible from by Twig's path() symfony symfony

Symfony 2: route defined in annotation not visible from by Twig's path()


Routes by annotations still need to be imported into routing.yml as so:

AcmeHelloBundle:  resource: "@AcmeHelloBundle/Controller"  type: annotation

This will tell the routing to scan the Controller directory of the Acme\HelloBundle and import all routes.

You can find more information about routing with annotations here. That link will also tell you how to activate routes as I have shown above.

Also, I noticed that your route annotation needs the name parameter to be accessible through register using the path function otherwise it'd be accessed through acme_bundlename_controllername_actionname:

@Route("/register", name="register")

Hope that helps!