Question

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!

Was it helpful?

Solution

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);
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top