Re: Re: New thread - Template base class design

From: Date: Fri, 11 Jun 2004 03:12:22 +0000
Subject: Re: Re: New thread - Template base class design
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30464@lists.php.net to get a copy of this message
On Jun 10, 2004, at 9:46 PM, Hans Lellelid wrote:
Greg Beaver wrote:
$tpl = &$tpl->create('savant'); // or $morecontrol = new Template_Foo; $morecontrol->doSomethingSpecialForFoo(); // initialize a new template from an existing sub-template $tpl = &$tpl->create($morecontrol); // etc. ?>
Damn, that's a cool design.
Not sure I understand that part yet. Me dumb. :-( But the part I do understand, the assign-to-property bit (which is *awesome*, thanks Greg!) I have put into my example implementation here, with attribution:
    http://wiki.ciaweb.net/yawiki/index.php?area=Savant&page=TemplateSource
It really does simplify things, just beautiful. Goes to show you how easy it is to get in a rut and not think of alternatives; I've been on the $vars (and then $vars/$refs) thing for a 18-24 months now. Much more elegant this way. -- Paul M. Jones Savant: the simple alternative to Smarty for PHP. http://phpsavant.com/ DB_Table: build RDBMS tables and XHTML forms in one PHP class. http://wiki.ciaweb.net/yawiki/index.php?area=DB_Table Yawiki: your collaborative online documentation system. http://yawiki.com/ Yawp: a single-file foundation for PHP applications. http://phpyawp.com/

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