Commit e359370b authored by Taddeüs Kroes's avatar Taddeüs Kroes

Added some comments

parent 9cd85a0c
...@@ -20,7 +20,7 @@ bind_textdomain_codeset($domain, 'UTF-8'); ...@@ -20,7 +20,7 @@ bind_textdomain_codeset($domain, 'UTF-8');
textdomain($domain); textdomain($domain);
/* /*
* Config * Load configs
*/ */
$config = load_config('config.json'); $config = load_config('config.json');
...@@ -33,23 +33,27 @@ if (isset($config['default_timezone'])) ...@@ -33,23 +33,27 @@ if (isset($config['default_timezone']))
define('ROOT_URL', $config['root_url']); define('ROOT_URL', $config['root_url']);
/*
* Set up app with custom Latte view
*/
$view = new Slim\Latte\LatteView(array( $view = new Slim\Latte\LatteView(array(
'path' => __DIR__ . '/templates', 'path' => __DIR__ . '/templates',
'cache' => __DIR__ . '/.cache/latte', 'cache' => __DIR__ . '/.cache/latte',
'configure_engine' => function ($engine) { 'configure_engine' => function ($engine) {
// support for {_'...'} syntax in latte templates
$engine->addFilter('translate', function($s) { $engine->addFilter('translate', function($s) {
return gettext($s); return gettext($s);
}); });
// install {form} macro's from Bootstrap form renderer
$engine->onCompile[] = function ($latte) { $engine->onCompile[] = function ($latte) {
$compiler = $latte->getCompiler(); $compiler = $latte->getCompiler();
Instante\Bootstrap3Renderer\Latte\FormMacros::install($compiler); Instante\Bootstrap3Renderer\Latte\FormMacros::install($compiler);
}; };
} }
)); ));
$app = new Slim\Slim(array( $app = new Slim\Slim(compact('view'));
'view' => $view
));
/* /*
* Database setup * Database setup
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment