Re: [PEPr] Comment on HTML::Template_Savant
| From: | Greg Beaver | Date: | Thu, 03 Jun 2004 10:40:16 +0000 |
| Subject: | Re: [PEPr] Comment on HTML::Template_Savant | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-29946@lists.php.net to get a copy of this message | ||
Alan Knowles wrote:
Ok I underestimated a little.. 66 lines.
http://devel.akbkhome.com/svn/index.php/akpear/Savant_tests/Savant.php
there's no filter code in there, I was thinking something along these lines would be the best way to implement filtering..
$template = new HTML_Template_Flexy(...)
$filter = new HTML_Template_Flexy(
'compiler' => 'regex',
'filters' => array(
'email',
'filter' => 'myfilters/filter1.php'
)
);
$template->assign(.....);
$template->compile('mytemplate.tpl');
$filter->compileString($template->toString());
$filter->output();
An idea raised recently on another list might work here too. Why not implement filters as stream wrappers? This way, any pre/post-processing can be handled indirectly without any need for support in the template engine. This would work for any template engine, old or new
Greg