Hey all I have a bit of a problem with root annotations in Symfony2.
I have two different controllers that call methods from the same URL positions /test.
Controller 1:
**
* @Route("/test", service="myProject.test.controller.art")
* @Cache(expires="+5 minutes", public=true)
*/
class BlogController
{
/**
* @Route("/{text}", defaults={"text" = null})
* @Route("/topic/{tag}", defaults={"tag" = null})
* @Method({"GET"})
*/
public function listAction(ArtQuery $query)
{
//.................
}
}
Controller 2:
**
* @Route("/test" , service="myProject.test.controller.sitemap"))
* @Cache(expires="+5 minutes", public=true)
*/
class SitemapController
{
/**
* @Route("/sitemap.xml/")
* @Method({"GET"})
*/
public function sitemapAction()
{
//..................
}
}
The problem is that the second Controller is never matched only if is add in my @route("/sitemap.xml/") but I realy want the route to be only @route("/sitemap.xml").
I think the problem is when i input the url /test/sitemap.xml Symfony treats sitemap.xml as /{text} variable route in first controller.
Can I make a exception so that first controller ends as soon as it hits sitemap.xml....?
I read something about requirements but dont quiet understand this concept