symfony/symfony — Issue #3056: Absolute asset URLs in a template
Author: weaverryan
Created: 2012-01-07 21:49:47+00:00
State: open

Hey guys!

See the old discussion here: http://groups.google.com/group/symfony-devs/browse_thread/thread/d7da04699033ec07

Currently, there's no standard way of (when you're not using a CDN) retrieving the absolute URL to an asset. This would be useful, for example, when generating asset paths in a template for an email. I believe the best *current* solution would be something like this:

{{ app.request.httpHost ~ asset('images/foo.jpg') }}

Of course, that'll break if/when I start using a CDN :).

Question: is this something we should add?