You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
785 B
PHP
32 lines
785 B
PHP
<?php
|
|
|
|
namespace BitCommunism\Twig;
|
|
|
|
|
|
use DI\Container;
|
|
use function DI\add;
|
|
use function DI\factory;
|
|
use function DI\get;
|
|
use function DI\object;
|
|
use function DI\string;
|
|
|
|
return [
|
|
'twig.paths' => add([
|
|
string('{basedir}/templates'),
|
|
__DIR__ . '/../templates',
|
|
]),
|
|
|
|
'twig.filtered_paths' => factory(function (Container $c) {
|
|
$paths = $c->get('twig.paths');
|
|
return array_filter($paths, 'is_dir');
|
|
}),
|
|
|
|
'twig.loader' => get(\Twig_Loader_Filesystem::class),
|
|
'twig.debug' => false,
|
|
'twig' => get(\Twig_Environment::class),
|
|
|
|
\Twig_Loader_Filesystem::class => object(\Twig_Loader_Filesystem::class)
|
|
->constructorParameter('paths', get('twig.filtered_paths')),
|
|
|
|
\Twig_LoaderInterface::class => get('twig.loader'),
|
|
]; |