Splendonia Splendonia - 3 years ago 384
Twig Question

Symfony2 - Hyperlink to an exterior url retrieved from database using TWIG

i'm using symfony 2.0.19, and i'm trying to create a hyperlink to an external URL, this URL is retrieved from database, i tried doing this

<td><a href="{{dominio.url}}">{{dominio.url}}</a></td>

but the path i get is a relative path to the url INSIDE the base url example "localhost/web/www.tralalalala.com" instead of just "www.tralalalala.com"

How do i do this?

Answer Source

I suggest you to build your own Twig filter.

If your url aldready have http://, don't add it, otherwise, add it.

Check here for how-tos.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download