-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path_config.php
38 lines (28 loc) · 942 Bytes
/
_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
require_once __DIR__ . '/code/TwigControllerTrait.php';
}
// If haml is available allow it to be used
if (class_exists('HamlSilverStripeContainer')) {
TwigContainer::addExtension('twig', function ($twig, $c) {
$twig->addExtension(new MtHaml\Support\Twig\Extension);
return $twig;
});
TwigContainer::addExtension('twig.loader', function ($loader, $c) {
return new MtHaml\Support\Twig\Loader($c['haml.env'], $loader);
});
TwigContainer::addShared('haml.env', function ($c) {
return $c['haml.dic']['environment'];
});
TwigContainer::extendConfig(array(
'haml.dic' => function () {
return new HamlSilverStripeContainer(array(
'environment.type' => 'twig'
));
},
'twig.extensions' => array(
'.haml',
'.twig'
)
));
}