Finding out the installed version of twig

Try it:

<p>The current version is {{ constant('Twig_Environment::VERSION') }}</p> 

You will find it in vendor/twig/twig/lib/Twig/Environment.php

/**
 * Stores the Twig configuration.
 *
 * @author Fabien Potencier <[email protected]>
 */
class Twig_Environment
{
    const VERSION = '1.24.0';

For later versions of Twig, e.g. 2.7 onwards, you will find it at /vendor/twig/twig/src/Environment.php

/**
 * Stores the Twig configuration.
 *
 * @author Fabien Potencier <[email protected]>
 */
class Environment
{
    const VERSION = '2.9.0';

Tags:

Php

Twig