$di->set('view', function() use ($config)
{
$view = new \Phalcon\Mvc\View();
$view->setViewsDir($config->application->viewsDir);
$view->registerEngines(array(
'.volt' => function($view, $di) use ($config) {
$volt = new VoltEngine($view, $di);
$volt->setOptions(array(
'compiledPath' => $config->application->cacheDir,
'compiledSeparator' => '_',
'compileAlways' => true
)); return $volt;
},
'.phtml' => 'Phalcon\Mvc\View\Engine\Php',
'.php' => 'Phalcon\Mvc\View\Engine\Php',
'.twig' => function($view, $di) {
$options = ['cache' => $config->application->cacheDir ]; //Setting up Twig Environment Options
$twig = new \Phalcon\Mvc\View\Engine\Twig($view, $di, $options);
return $twig;
}
));
return $view;
}, true);
Twig work's fine showing the content, but I wanna cache the content inside my directory $config->application->cacheDir
, volt work's great and create the "compiled" files, but why twig doesn't if I'm passing the correct option cache
= directory....?