$form = new HTML_Template_Flexy();
$form->compile($this->masterTemplate);
// create an instance (note you dont have to specify any details..)
$elements['theform'] = new HTML_Template_Flexy_Element;
// change an attribute
$elements['theform']->attributes['action'] = 'http://pear.php.net';
//
// for the different types of elements:
$elements['test_textarea'] = new HTML_Template_Flexy_Element;
$elements['test_textarea']->setValue('Blogs');
// select options
$elements['test_select'] = new HTML_Template_Flexy_Element;
$elements['test_select']->setOptions( array(
'123' => 'a select option',
'1234' => 'another select option'
));
$elements['test_select']->setValue('1234');
// checkboxes
$elements['test_checkbox'] = new HTML_Template_Flexy_Element;
$elements['test_checkbox']->setValue(1);
// array type checkboxes..
$elements['test_checkbox[]'] = new HTML_Template_Flexy_Element;
$elements['test_checkbox[]']->setValue(array(1,2));
// radio buttons
$val = 'yes';
$elements['test_radio'] = new HTML_Template_Flexy_Element;
// if you have a default - you may want default to using it..
$elements['test_radio']->setValue($val != 'no' ? $val : 'no');
$form->output(new StdClass, $elements);
// in the example below, the new data you have added is to the existing attributes |