Re: New thread - Template base class design

From: Date: Fri, 11 Jun 2004 03:40:50 +0000
Subject: Re: New thread - Template base class design
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30466@lists.php.net to get a copy of this message
On Jun 10, 2004, at 10:34 PM, Greg Beaver wrote:
Paul M Jones wrote:
I'm skipping to the interesting part (for me).
ditto ;)
It does mean that one would have to set all vars singly ... unless setData() interfaced with the class vars themselves, not some sort of $vars array, e.g. ... function setData($array) {
    foreach ($array as $key => $val) {
        if ($key{0} != '_') {
            $this->$key = $val;
        }
    }
}
Another idea: if we provide a "fromObject" method that is like so:
Things like extended DB_Result objects can set template data directly, then. Ehhxcellent. Am working on a basic "driver" piece now, Alan is certain to have better ideas than me on that one; am copying the DB/Horde/whoever methodology directly from a message Jan Schneider sent me in the Text_Wiki Earthquake thread. -- 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 (#30466) next »