18 lines
444 B
PHP
18 lines
444 B
PHP
<?php declare(strict_types=1);
|
|
|
|
// config/packages/twig.php
|
|
use Symfony\Config\TwigConfig;
|
|
|
|
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
|
|
|
|
use App\Service\WhoAreYou;
|
|
|
|
return static function (TwigConfig $twig): void {
|
|
$twig
|
|
->fileNamePattern('*.twig')
|
|
->global('username', service(WhoAreYou::class));
|
|
|
|
if ($_SERVER['APP_ENV'] === 'test') {
|
|
$twig->strictVariables(true);
|
|
}
|
|
};
|