Beispiel #1
0
 /**
  * Overrides render() in App_Form
  * 
  * @param Zend_View_Interface $view 
  * @access public
  * @return string
  */
 public function render(Zend_View_Interface $view = NULL)
 {
     foreach ($this->getElements() as $element) {
         $this->_replaceLabel($element);
         switch (TRUE) {
             case $element instanceof Zend_Form_Element_Hidden:
             case $element instanceof Zend_Form_Element_Hash:
                 $this->_addHiddenClass($element);
                 break;
             case $element instanceof Zend_Form_Element_Checkbox:
                 $this->_appendLabel($element);
                 break;
             case $element instanceof Zend_Form_Element_MultiCheckbox:
                 $element->getDecorator('Label')->setOption('tagOptions', array('class' => 'checkboxGroup'));
                 $element->getDecorator('HtmlTag')->setOption('class', 'checkboxGroup');
                 break;
         }
     }
     //$this->_cancelLink();
     $this->getDecorator('HtmlTag')->setOption('class', 'zend_form clearfix');
     if (NULL === $this->getAttrib('id')) {
         $controllerName = Zend_Registry::get('controllerName');
         $actionName = Zend_Registry::get('actionName');
         $this->setAttrib('id', $controllerName . '-' . $actionName);
     }
     return parent::render($view);
 }
 /**
  * Overrides render() in App_Form
  * 
  * @param Zend_View_Interface $view 
  * @access public
  * @return string
  */
 public function render(Zend_View_Interface $view = NULL)
 {
     $this->clearDecorators();
     $this->setDecorators(array(array('ViewScript', array('viewScript' => $this->_partial, 'form' => $this, 'view' => $this->getView()))));
     foreach ($this->getElements() as $element) {
         $element->clearDecorators();
         if ($element instanceof Zend_Form_Element_File) {
             $element->setDecorators(array(array('File'), array('Errors')));
         } else {
             $element->setDecorators(array(array('ViewHelper'), array('Errors')));
         }
         $element->getView()->getHelper('FormErrors')->setElementStart('<strong class="error"><em>');
         $element->getView()->getHelper('FormErrors')->setElementEnd('</em></strong>');
         $element->getView()->getHelper('FormErrors')->setElementSeparator('</em><em>');
     }
     if (NULL === $this->getAttrib('id')) {
         $controllerName = Zend_Registry::get('controllerName');
         $actionName = Zend_Registry::get('actionName');
         $this->setAttrib('id', $controllerName . '-' . $actionName);
     }
     return parent::render($view);
 }