I add function to compiler:
$view->registerEngines([
'.volt' => function ($view, $di) {
$config = $this->getConfig();
$volt = new VoltEngine($view, $di);
$volt->setOptions([
'compiledPath' => $config->application->cacheDir,
'compileAlways' => $config->dev_environment,
'stat' => $config->dev_environment,
'compiledSeparator' => '_'
]);
$compiler = $volt->getCompiler();
if ($config->dev_environment){
$compiler->addFunction(
'kint',
function ($resolvedArgs, $exprArgs) {
return 'd('.$resolvedArgs.')'; // <-- kint function
}
);
}
return $volt;
},
'.phtml' => 'Phalcon\Mvc\View\Engine\Php'
]);
in index.php
/**
* Debug
*/
if($app->config->dev_environment){
//require '../vendor/raveren/kint/Kint.class.php';
Kint::$theme = 'solarized';
$debug = new \Phalcon\Debug();
$debug->listen();
}
composer:
{
"require": {
},
"require-dev": {
"raveren/kint": "*"
}
}
Work fine.