I have an application with Symfony2 (2.2). When I want to send a mail, I'm having trouble with the paths, which are all relative paths and obviously aren't working inside emails
for rendering 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 therefore I need to append the 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, as I have different domains.
Update
I found the solution for paths with the url
function but I still need a solution for assets.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…