Hello, i do this in the public/index.php file in order to set var/compiled_templates as Volt compliedPath attribute, but Volt still using views directory as default, what is the problem ? the var directory is in the root path of the app and have the same level as public directory.
$di->set("voltService", function($view, $di) {
$volt = new Volt($view, $di);
$volt->setOptions(array(
"compiledPath" => "../var/compiled_templates/",
"compiledExtension" => ".compiled"
));
return $volt;
});
// inject View service to the dependeny container
$di->set('view', function() use ($config){
$view = new Phalcon\Mvc\View();
$view->setViewsDir($config->application->views_dir);
$view->registerEngines(
array(
".volt" => "Phalcon\Mvc\View\Engine\Volt"
)
);
return $view;
});