Pregunta

I'd like to distribute .volt template files to my system's registered users, however I want it to strip away all <?php tags.

Can it be done using some sort of callback?

Thanks!

¿Fue útil?

Solución

There are the table with all available filters http://docs.phalconphp.com/en/1.2.6/reference/volt.html#filters

but if you want something else, you should write your own filter, which you would use in volt:

http://docs.phalconphp.com/en/1.2.6/reference/volt.html#id3

something like this: (not tested)

$compiler->addFilter('escapePHP', function($resolvedArgs, $exprArgs) {
    return str_replace(array('<?', '<?php'), '', $resolvedArgs);
});
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top