ramiromd
ramiromd

Reputation: 2029

Links in Symfony2

im have a page. The url page is:

mydomain/web/app_dev.php/Common/homePage

And i need create a link. The href of anchor must be link to

mydomain/web/app_dev.php/Menus/seleccionarMenu

The action of the second link, is in other controller, in other bundle. How make this ?.

Any ideas ?

Upvotes: 1

Views: 441

Answers (1)

moonwave99
moonwave99

Reputation: 22810

Use path():

<a href="{{ path( routeName ) }}">Some Text</a>

routeName follows basic Symfony naming conventions, or explicit name if given in route annotation.

Upvotes: 3

Related Questions