-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Feature Request] Absolute asset URL #5322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What about using |
@willdurand the issue is that it will make all asset url absolute, even when not really needed. and it will make it more difficult for the dev setup, as each dev will have to change the config according to the base url he has locally. So this solution is not a perfect one either. |
@stof Exactly, this is fundamental for many things. |
For now, you can do : {{ app.request.getSchemeAndHttpHost ~ asset('images/foo.jpg') }} One of the other duplicate issues : #3056 |
I have the same issue. I would have liked to avoid having a specific parameter in my config.yml just for this purpose (as it now works for url as in 2.1). |
@stof You can set |
I'll take a stab at it |
Or even:
|
Implemented in #10451 |
Hum ... Sorry for re-opening this old thread but this seems to get removed in https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Extension/AssetExtension.php#L54 |
Hey guys!
Currently, there's no standard way of retrieving the absolute URL to an asset. This would be useful when generating asset paths in a template for an email. Would be cool a function like:
{{ asset_url('images/foo.jpg') }}
The current solution is not pratical and breaks when using CDN.
Thanks,
Marcos
The text was updated successfully, but these errors were encountered: