ZF-10491: addDisplayGroup with variable



i use Zend_Form myself in this form:

$phone = new Zend_Form_Element_Text('phoneNr'); $phone->setLabel('phoneNr'); $phone->setFilters(array('StringTrim')); $phone->setValue($this->_data->phoneNr); $this->addElement($phone);

When i want to add such a form element to a display group, i have to type the "id" of the element, instead of the variable:

$this->addDisplayGroup(array('phoneNr'), 'name', ...);

Better would be: $this->addDisplayGroup(array($phone), 'name', ...);


I think it would make sense to implement this functionality. Precondition should be that the element defined in the variable is already added to the Zend_Form instance to be consistent with the current functionality.

I've uploaded a patch that enables this functionality, and a unit test.

[SVN:r23412:bittarman] ZF-10491: Applying patch from Richard Tuin (See:

Merged to branch release 1.11 r23422.