twigphp / Twig

Twig, the flexible, fast, and secure template language for PHP
https://twig.symfony.com/
BSD 3-Clause "New" or "Revised" License
8.15k stars 1.24k forks source link

URL Generation in Templates #2025

Closed jwcodesjs closed 8 years ago

jwcodesjs commented 8 years ago

My team is having issues generating urls in templates. We're using Symfony3

Using absolute_url we get a double http in the link http://http//site.net Using url we get a relative path Path has always been relative.

We're having to generate absolute URL's in the controller and pass to the template, otherwise the link is broken.

jwcodesjs commented 8 years ago

Nevermind! Had both the following defined: router.request_context.host: http://site.net router.request_context.scheme: http