Friday, October 1, 2010

Using url_for() in an Action - Symfony

In an symfony template you can get the base url of the application with:
url_for('@homepage', true);

Using this code in an action causes:
Fatal error: Call to undefined function url_for() in ...

In an action this code should be used instead:
$baseUrl = $this->getController()->genUrl('@homepage', true);

0 comments:

Post a Comment