Re: [Template] Design issues

From: Date: Sat, 12 Jun 2004 02:38:14 +0000
Subject: Re: [Template] Design issues
References: 1 2 3 4 5 6 7 8  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30533@lists.php.net to get a copy of this message
Paul M Jones wrote:
Another note -- I know you don't like it, but in lieu of other plans, I still think toString() is the place to do the work, not output(). Yes, it requires the use of ob_*() every time, but: you can register a filter provider and it can act on the buffered string, then return to output. I'm not sure there's another way to do it, really, and I like the idea of output filters for various reasons.
output buffering all the time is going to kill performance on large resultsets. I was thinking about filtering last night.. - made a brief reference to it in the email: class Template_Filtered extends Template { function Template_Filtered ( $options = array() ) { Template::Template($options); } function output() { $result = $this->toString(); foreach ($this->filters.....) $result = $this->filters[$i]->parse($result); } } } since filters effectively wrap the output of the Template result, so as a metaphore, the Class wraps the Template Class.. -- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.pear.dev (#30533) next »