Top "Twig" questions

Twig is a modern, fast, flexible, and secure templating engine for PHP.

How to render Twig template from database in symfony2

I'm working on application written in symfony2 and I want to send email after some action/event... the problem is, …

email symfony render twig
What is the difference between 'url' and 'path' in symfony2.3

The document said {# src/Acme/ArticleBundle/Resources/views/Article/recentList.html.twig #} {% for article in articles %} <a href="{{ path(…

symfony twig
twig - pass function into template

Currently I place my function in a class and pass an instance of this class into template and call my …

php function inheritance twig template-engine
How to render a tree in Twig

I would like to render a tree with an undetermined depth (children of children of children, etc.). I need to …

loops recursion tree twig
Symfony 'trans' domain inside Twig template

I'd like to do this: $this->get('translator')->trans('notice.unregistered', array(), 'index'); Inside Twig template, so …

symfony localization twig gettext
How to check if a block exists in a twig template - Symfony2

Imagine I have something like this in my twig template {% block posLeft %} ----- {%endblock%} Is there any way to check …

symfony twig
"While" and "repeat" loops in Twig

Are there any nice ways to use while and repeat loops in Twig? It is such a simple task, but …

php symfony loops twig cycle
Symfony2 - form_start function customise in twig

Form helpers form_start and form_end are useful in twig: {{ form_start(form) }} {{ form_end(form) }} I can customise …

forms symfony twig symfony-forms symfony-2.3
How to install the Intl extension for Twig

The Intl extension is an extension for Twig that adds the localizeddate, localizednumber and localizedcurrency filters. How can I install …

php twig intl twig-extension
getting route name not the route path in twig symfony

i'm developing an application with symfony3. I want to get route name in twig. i did this : {% set current_path = …

twig symfony router