1
0
mirror of https://gitnet.fr/deblan/gist.git synced 2021-08-14 08:30:49 +02:00
GIST/app/bootstrap.php.d/20-twig.php
Simon Vieille 809aa35989 viewer
2015-05-06 22:24:42 +02:00

22 lines
480 B
PHP

<?php
use Silex\Provider\TwigServiceProvider;
$app->register(new TwigServiceProvider(), array(
'twig.path' => $app['root_path'].'/src/Gist/Resources/views',
));
$app->extend('twig', function ($twig, $app) {
$twig->addGlobal('web_path', $app['request']->getBaseUrl().'/');
return $twig;
});
$app['geshi'] = function ($app) {
$geshi = new GeSHi();
$geshi->enable_classes();
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
return $geshi;
};