New to some of the Zend_Form pieces and trying to migrate some old code
to ZF. I was curious whether there is a way to use Zend_Form with html
array syntax and have Validation and Filtering work.
I would like to have a form like this:
<form method='post' action='/controller/action'>
<input type='text' name='node[23][name]'>
<input type='text' name='node[25][name]'>
<input type='text' name='node[28][name]'>
<input type='submit' value='click me'>
</form>
Seems pretty standard but Zend_Form when created like this wants to flatten it
out:
$form=new Zend_Form();
$form->setAction('/controller/action/')->setMethod('post');
$main_header=$form->addElement('text','node[23][name]', array('label'=>'Menu
Header'));
$main_header=$form->getElement('node[23][name]')
->setRequired(true);
$submit=$form->addElement('submit','submit');
will make node[23][name] into node23name?
Is there any way to support this via Zend_Form (and ideally on the converse
Model object)?
here's something close:
http://davidcaylor.com/php/building-table-based-forms-in-zend_form
thanks,
jt