Finding out which version of the Twig you have installed in Symfony framework can be useful when solving bugs or installing packages. This tutorial shows how to check Twig version in Symfony.
We can use the Environment::VERSION
constant to determine Twig version.
<?php
use Twig\Environment;
require_once __DIR__.'/vendor/autoload.php';
echo Environment::VERSION;
This constant can be used in the template as follows:
{{ constant('Twig\\Environment::VERSION') }}
Leave a Comment
Cancel reply