Hi all, Well, we here at Namesco are working hard to get a release package together for the Zend/PHPTal integration 'glue' we've developed for our own internal codebase (which we've called ZTal) and this has full integration with Zend_Form. As such it includes a large number of macros for rendering different form elements - although, of course, they expect to be given a Zend_Form object :) Even if you are not using Zend it should be reasonably easy to re-use the macros :)
The code is ready but the documentation is rather lacking so at a guess I'd say it will be a few days before we release. I'll obviously let everyone know when everything is live :) Robert On 2 Aug 2010, at 19:27, Richard Dyce wrote: > Hi, > > Just a pre-re-invent-the-wheel inquiry... Does anyone have an example of > macros for formatting form fields in phptal? > > I have an older framework which create field objects based on the data and > type, and populates them from a simple array: > > e.g. > > <?php > > $fields = array( > 'id' => array('label'=>'', 'type'=>'hidden', 'value'=>2), > 'name' => array('label'=>'Name', 'type'=>'text', 'value'=>'John Smith'), > 'user' => array('label'=>'Owner', 'type'=>'select', > 'valuelist'=>array(1,2,3), 'value'=>2) > ); > > ?> > > It seems daft me to duplicate the logic twice over, and it appears that > phptal might be able to handle it with some repeats and templating. But > before I tie myself in knots over this, has anyone already done it, or tried > it and found the gotcha ;-) > > Thanks, > > R > _______________________________________________ > PHPTAL mailing list > PHPTAL@lists.motion-twin.com > http://lists.motion-twin.com/mailman/listinfo/phptal
PGP.sig
Description: This is a digitally signed message part
_______________________________________________ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal