Details
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
<dt></dt>
<dd>
<input type="text" name="foo" id="foo" value="">
</dd>
<form enctype="application/x-www-form-urlencoded" action="" method="post">
<dl class="zend_form">
<dt></dt>
<dd>
<input type="text" name="array[foo]" id="foo" value=""></dd></dl>
</form>
<dt></dt>
<dd>
<input type="text" name="array[foo]" id="foo" value="">
</dd>
Please notice that the first rendered element isn't in array and after rendering whole form it is.
Issue Links
| This issue is related to: | ||||
| ZF-2883 | Elements in DisplayGroups do not adhere to array notation of parent sub form |
|
|
|
Please evaluate and categorize as necessary.