PHP code example of buzzingpixel / twig-getenv

1. Go to this page and download the library: Download buzzingpixel/twig-getenv library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

buzzingpixel / twig-getenv example snippets



declare(strict_types=1);

use Twig\Environment;
use Twig\Loader\FilesystemLoader;
use buzzingpixel\twiggetenv\GetEnvTwigExtension;

$twig = new Environment(new FilesystemLoader('/path/to/templates'), [
    'debug' => true,
    'cache' => '/path/to/cache',
    'strict_variables' => true,
]);

$twig->addExtension(new GetEnvTwigExtension());