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

Reply via email to