How to use absolute path in twig functions

后端 未结 9 1088
情话喂你
情话喂你 2020-12-04 16:35

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

9条回答
  •  情深已故
    2020-12-04 16:53

    Symfony 2.7 has a new absolute_url which can be used to generate the absolute url. http://symfony.com/blog/new-in-symfony-2-7-the-new-asset-component#template-function-changes

    It will work on those both cases or a path string:

    A link
    

    and for assets:

    Title
    

    Or for any string path

    Title
    

    on those tree cases you will end up with an absolute URL like

    http://www.example.com/my/absolute/path
    

提交回复
热议问题