Reputation: 1309
i have a staticController with actions for the following example links:
/register /imprint
this is the example annotation:
/**
*@Route("/imprint", name="user.static.imprint")
*/
And now i have the following annotation for linking other pages with dynamic linknames:
/**
*@Route("/{area}", requirements={"id" = "!imprint"}, name="user.area.index")
*/
I'm using the path() function in twig to create the links.
The generated link /imprint ist now routing to the second annotation. How can i avoid this problem?
Thank you very much.
Upvotes: 4
Views: 3498
Reputation: 8425
Second route matches same pattern as first and interferes with it, so you need to put first in priority.
Somewhere in your project you're importing these two controllers routes as annotations (Probably /app/config/routing.yml
). Looks something like this:
bar_route:
resource: "@FooBundle/Controller/BarController.php"
type: annotation
prefix: /
Right now most likely second controller import is above first. Reverse that.
Upvotes: 3