Top "Twig" questions

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

How to center text with Markdown?

How do you center an item with Markdown? I'm looking for a solution that works in Grav. I can't find …

html css twig markdown grav
Twig date difference

I've got an entity with a starting date and an ending date. Is it possible to get the difference in …

datetime twig datediff
Set default value of Symfony 2 form field in Twig

Is it possible to set default value of input field in Twig ? I am rendering form row with: {{ form_widget(…

forms symfony twig
How to retrieve all Variables from a Twig Template?

Is it possible to retrieve all variables inside a Twig template with PHP? Example someTemplate.twig.php: Hello {{ name }}, your …

php symfony twig template-engine
Increment declared integer variable

I try to do zebra striping: {% set counter = 0 %} {% for entity in entities %} <tr class="{{ cycle(['odd', 'even'], counter) }}"> {% …

twig
Symfony translations not working

I have done the following checklist: created translation file respecting format domain.lang.loader cleared cache checked that language catalogue …

symfony twig translation
How can I get timestamp value in Twig?

How can I get timestamp value in twig as I know date formatting is possible in twig but don't know …

symfony twig
Extending language definitions (for code highlighting) in notepad++

I've been doing development in TWIG lately. It is an html templating language that is very simple and robust. I've …

syntax-highlighting notepad++ twig
Persistent :set syntax for a given filetype?

I'm working on a Symfony2 project which uses Twig, and the filetypes are myfile.html.twig. Vim doesn't automatically detect …

syntax-highlighting vim twig macvim
How to make form_rest() not display a field with Symfony2?

I've started to use Symfony2 but I've some problems. I wanted to render fields by hand but it doesn't work …

php forms symfony twig