Top "Twig" questions

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

How to use php json_encode options in twig file with json_encode twig function

I am trying to use twig json_encode function but when I do this var packageDetails = {{(packageDetails|json_encode)}}; and …

php symfony twig
How to render CSRF input in twig?

I know there's the usual way to render CSRF token hidden input with form_rest, but is there a way …

php symfony csrf twig
PhpStorm wrap/surround selection?

Often in coding and templating I need to wrap a certain part of text. Is there any shortcut to wrap …

twig phpstorm keyboard-shortcuts settings
Symfony2 - Twig - How can I send parameters to the parent template?

I am working on a PHP project using Symfony2 with Twig templating, and I can't find a solution for this …

php symfony twig
Check if {{ path() }} is current {{ path() }} in Symfony2

How do I check if the current page is this path: {{ path('someNamePath') }} I want to set a css class …

php symfony twig
Overriding blocks within included Twig templates

Is there a generally "good" way to achieve this functionality? I have read about the 'use' tag, which seems like …

php twig
Flash-Messages in Symfony2 doesn't seem to work in my twig-template

I want to add support for flash messages on our pages. I implemented this by following the documentation found here. …

templates symfony twig flash-message
getting error that a template that extends can not have body

I am working on jobeet tutorial. When I am running the project on localhost like this: http://localhost/Symfony/web/…

symfony twig
"Begins with" in Twig template

I have a twig template where I would like to test if an item begins with a certain value {% if …

php regex twig comparison
Create a link with an anchor with Twig path function in Symfony 2

I'm trying to create a link with an anchor like "www.example.com/services#anchor1" in my Twig template. So …

symfony twig