Example #1
0
 /**
  * Add a display group object (used with cloning)
  *
  * @param  Zend_Form_DisplayGroup $group
  * @param  string|null            $name
  * @throws Zend_Form_Exception
  * @return Zend_Form
  */
 protected function _addDisplayGroupObject(Zend_Form_DisplayGroup $group, $name = null)
 {
     if (null === $name) {
         $name = $group->getName();
         if ('' === (string) $name) {
             require_once 'Zend/Form/Exception.php';
             throw new Zend_Form_Exception('Invalid display group added; requires name');
         }
     }
     $this->_displayGroups[$name] = $group;
     $group->setForm($this);
     if (!empty($this->_displayGroupPrefixPaths)) {
         $this->_displayGroups[$name]->addPrefixPaths($this->_displayGroupPrefixPaths);
     }
     $this->_order[$name] = $this->_displayGroups[$name]->getOrder();
     $this->_orderUpdated = true;
     return $this;
 }