Reputation: 2807
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!
Upvotes: 0
Views: 489
Reputation: 26403
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);
});
Upvotes: 3