ZF-9451: Zend_Form* elementsBelongTo and belongsTo coexistence

Issue Type: Sub-task Created: 2010-03-18T02:08:28.000+0000 Last Updated: 2010-04-15T12:25:43.000+0000 Status: Closed Fix version(s): Reporter: Christian Albrecht (alab) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: Attachments: -


At the moment setting elementsBelongTo on a (Sub)Form overwrites the belongsTo setting of any Element appended to this form.

This fix makes it possible to have belongsTo indepedent from elementsBelongTo in a manner that when setting elementsBelongTo the value is stored in an extra member within Zend_Form_Element, namely belongsToBase, after stripping the old belongsToBase from belongsTo, and prepending the new belongsToBase to belongsTo.

<pre class="highlight">
$form    = new Zend_Form(...'elementsBelongTo' => 'form[elementsBelongTo]'...);
$element = new Zend_Form_Element(...'name' => 'element' ... 'belongsTo' => 'belongsTo'...);

/** Before Patch */
$element->getFullyQualifiedName(); // form[elementsBelongTo][element]

/** After Patch */
$element->getFullyQualifiedName(); // form[elementsBelongTo][belongsTo][element]


Posted by Christian Albrecht (alab) on 2010-04-15T12:25:42.000+0000

After talking to Matthew it is clear now that elementsBelongTo supersedes belongsTo so i close this issue.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.