Commit 2b82d420 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Made Latte cache dir configurable

parent 9373a74b
...@@ -40,9 +40,12 @@ define('ROOT_URL', $config['root_url']); ...@@ -40,9 +40,12 @@ define('ROOT_URL', $config['root_url']);
* Set up app with custom Latte view * Set up app with custom Latte view
*/ */
if (!file_exists($config['cache_dir']))
mkdir($config['cache_dir'], 0777, true);
$view = new Slim\Latte\LatteView(array( $view = new Slim\Latte\LatteView(array(
'path' => __DIR__ . '/templates', 'path' => __DIR__ . '/templates',
'cache' => __DIR__ . '/.cache/latte', 'cache' => $config['cache_dir'] . '/latte',
'configure_engine' => function ($engine) { 'configure_engine' => function ($engine) {
// support for {_'...'} syntax in latte templates // support for {_'...'} syntax in latte templates
$engine->addFilter('translate', function() { $engine->addFilter('translate', function() {
......
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