I have an application with Symfony2 (2.2). When I want to send mail, I have problems with paths, which are relative paths and obviously do not work inside emails.
to display the paths I'm using:
<a href="{{ path('route_name', {'param' : value}) }}">A link</a>
and for assets:
<img src="{{ asset('bundle/myname/img/image.gif') }}" alt="Title"/>
The previous examples work fine, but the paths are relative, so I need to add a domain. I can do something like:
<a href="http://domain.com{{ path('route_name', {'param' => param1}) }}">A link</a>
but this is not the best solution for my problem, since I have different areas.
Update
I found a solution for the paths using the url function, but I still need an asset solution.
symfony twig routing
rkmax Jun 11 '13 at 16:58 2013-06-11 16:58
source share