Closed w3q closed 8 years ago
It’s defined in a custom router: SlugRouter
I see, but why it symphony throwing me error that it can not find a route then?
Has anyone an idea what it can be ? I guess the SlugRouter function to add a route will not be called and so it will not add the route, but I don't know why.
Can you not inject the Kunstmaan SlugRouter in your code and use that to generate your url? That way you would be guaranteed to have the '_slug' url defined.
What exactly do you mean by that? It stopped functioning and I have no idea why. I'm trying to get it working, but have no idea why it is not called to add a route.
Your code probably overrides the router used by the defaultcontroller so it does not actually use the Kunstmaan SlugRouter. Which is why the '_slug' route is not defined. But I'm just guessing now. Do you have the code somewhere public so I could take a look at it and try to give a more educated answer?
Actually, we have been able to figure it out just few minutes ago. The thing was exactly what you have said. We just changed the order of routers and it is okay now.
Thank you.
Happy to have been helpful :) Would you be so kind as to close this issue then? thanks.
Hello, I'm trying to merge my code into kunstmaan CMS and i have found one issue, maybe you will know how to resolve that.
The thing is that i've implemented some routing from my existing bundles that I've brought to Kunstmaan cms. Now, when I'm trying to hit the homepage /, it will get error: Unable to generate a URL for the named route "_slug" as such route does not exist.
This happens because the default controller does this: return new RedirectResponse($this->generateUrl('_slug', array('url'=>'', '_locale'=>$this->container->getParameter('locale'))));
I have not been able to find out how this is redirected to correct route, since i did not found any route named _slug. How does this work?