Top "Twig" questions

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

Symfony2 -> Twig -> Form -> Field -> Set rendered = true

i have a simple problem. I have a form with a field for example: $builder ->add('x') -&…

symfony twig symfony-forms symfony-2.2 symfony-2.3
Get translated country name from a 2 digit country code in Symfony2/Twig?

I'm using the Symfony2 country Field Type, it works well and country names are translated. I am storing the two-digit …

symfony twig symfony-forms
Run CSS file through Twig when using {% stylesheets %} tag in Twig with Symfony2

I'm including CSS stylesheets in my template like so: {% stylesheets "@SomeBundle/Resources/assets/css/default.css.twig" "@SomeBundle/Resources/assets/…

css symfony twig assetic
Get cookie from Twig template

I'm trying to access cookies I set in my Drupal website. I created two cookies on a form submission : with …

symfony cookies twig drupal-8
How can I display a formatted date from a Unix timestamp in twig?

I would like to display a formatted date in twig by applying a filter to a Unix timestamp. Is such …

php symfony filter twig unix-timestamp
Twig: set a variable inside a loop, use it outside that loop

I'm trying to define driverid, using set, as a var in for driver in assigned.driver cycle for use later. …

php symfony twig symfony-2.4
Extending or including - what is better in Twig?

Why Twig documentation recommends to use extending rather than including? Symfony 2 documentation says because "In Symfony2, we like to think …

php symfony twig template-engine
WordPress Timber getting posts of a custom post type

I'm just digging into WordPress plus Timber and I came upon a problem that I can't resolve. I have created …

php wordpress twig timber
Sonata Media Bundle : acces media url

I am using sonata media bundle. and I was wondering how can I access the media url in twig. I …

symfony twig sonata-admin
Symfony2 : Auto htmlentities using Twig

I'm displaying some variable retrieved in my database using Twig : <p>{{ my_variable }}</p> The thing …

symfony twig html-entities