Volt template - how escape parsing?

I need something like this:

http://www.smarty.net/docs/en/language.escaping.tpl

how to do it in phalcon?

As a workaround: Embed it in <?php blocks (echo or something), as Volt does not touch already existing PHP code in the templates.



1.4k

Thank for your help. I found other solution. In view my code is:

{{ include_raw('path_to_my_view') }}

include_raw code is:

$view->registerEngines(array(
    '.volt' => function($view, $di) {
        $volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
        $volt->setOptions(array(
            'compiledPath' => '../app/compiled/',
            'compileAlways' => true 
        ));
        $compiler->addFunction('include_raw', function($resolvedArgs, $exprArgs) use ($view) {
            return sprintf('file_get_contents("%s" . %s)', $view->getViewsDir(), $resolvedArgs);
        });
        return $volt;
    }
));