Let’s say I have an action:
/**
* @Route("/current")
*
* @return Response
*/
public function currentAction()
{
}
And now I need to generate url to this action. $this->generateUrl() controller’s method accepts route name as an argument. Obviously I have no such name as long as I use annotations.
Any workarounds for this?
Got it:
Found it by reading sources, but actually it is explained in documentation as well: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/routing.html#route-name
As @Mihai Stancu mentioned – there is always a default name:
in this case it will be a
bundlename_controllername_current