此代码显示所有表单元素,但我想通过 formCollection 迭代以对表单元素做一些事情?任何帮助表示赞赏。
echo '<h1>view\add.phtml</h1>';
$form = $this->form;
$form->prepare();
$form->setAttribute('action', $this->url('album/default',
array('controller' => 'Index', 'action' => 'add')));
$form->setAttribute('method', 'post');
$form->setAttribute('ID', 'creatEvent');
echo $this->form()->openTag($form);
**echo $this->formCollection($form);**
echo $this->form()->closeTag();