Home  >  Q&A  >  body text

symfony - how to configure a public template variable

How to configure a public template variable, I now want to configure a css domain name. I want to configure it in a public configuration file and then remove it from the template. How should it be configured and implemented in symfony2? Asking for configuration method and template calling method

我想大声告诉你我想大声告诉你2692 days ago482

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-16 16:47:09

    In app/config/config.yml:

    twig:
        globals:
            css_host: css1
    

    In your template:

    {{ css_host }}.example.com
    

    reply
    0
  • Cancelreply