Issues

ZF-3146: wrong behaviour conected with setElementsBelongTo

Description

Hi, I have this piece of code <?php set_include_path(get_include_path() . PATH_SEPARATOR .dirname(__FILE__)); require_once('Zend/Loader.php'); Zend_Loader::registerAutoload(); $view = new Zend_View(array('encoding' => 'UTF-8')); $form = new Zend_Form(); $element=$form->createElement('text','foo'); $form->addElement($element); $form->setElementsBelongTo('array'); echo $form->foo->render($view); echo $form->render($view); echo $form->foo->render($view); ?>

and the output is something like this

<input type="text" name="foo" id="foo" value="">

<input type="text" name="array[foo]" id="foo" value="">

Please notice that the first rendered element isn't in array and after rendering whole form it is.

Comments

Please evaluate and categorize as necessary.

Scheduling for next mini release.

Fixed in trunk and 1.5 release branch as of r9402.