Top "Twig" questions

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

How to get assets img url in Symfony controller

I'm using assets in Symfony 2.7.10 and I want to generate an image url in the controller. In the symfony config.…

symfony twig assets
Twig instanceof for inheritance objects

I am using the following feature from propel http://www.propelorm.org/documentation/09-inheritance.html. I am also using Symfony2 …

symfony propel twig single-table-inheritance
How can I define global variables inside a twig template file?

Is it possible to set global variables in a twig file, so that I can access that variables from other …

php variables twig global templating
Twig check if file exists

Hello so I am using slim framework and twig, and here is my current code in php: $filename = '/path/…

php twig file-exists
Including Assets (CSS, JS) in Symfony 4 / Twig Template

Im learning Symfony and trying to set up a boilerplate app in Symfony 4 This Symfony document describes how to include …

php css symfony twig symfony4
How do you retrieve current date for Symfony2

I'm a newbie in Symfony 2 and i would like to know how do i get current date(today's date) from …

symfony twig
FOSUserBundle: How to best integrate login and register form in one template?

I am using the FOSUserBundle in my Symfony application which is really great. They have the login and register forms …

templates symfony login twig fosuserbundle
Symfony2 is_granted('IS_AUTHENTICATED_FULLY') during 404 error page display, causing ResourceNotFoundException

I have setup custom error pages to display for certain HTTP errors in the folder: app/Resources/TwigBundle/views/Exception/ …

twig symfony-2.1
Using an environment variable (from `.env` file) in custom Twig function in Symfony 4

How can I use an environment variable from the .env file in a custom Twig function (\Twig_SimpleFunction) in Symfony 4?

twig environment-variables symfony4 twig-extension
How can I reuse a block multiple times?

How can I render a block multiple times within a view in a twig template? Currently I do have a …

symfony twig