ZF-11257: setIsArray does not work with decorators
Description
Everything is in the title. Zend_Form->setIsArray does not work with decorators.
$screen_name = $this->createElement('text','screen_name')
->addFilter('stringTrim')
->addFilter('stripTags')
->setIsArray(true);
result is :
$screen_name = $this->createElement('text','screen_name')
->addFilter('stringTrim')
->addFilter('stripTags')
->setDecorators(array('Col'))
->setIsArray(true);
result is :
the [] disappears...
Comments
Posted by Kai Uwe (kaiuwe) on 2011-04-04T18:21:00.000+0000
The standard decorators from Zend_Form doesn't include a decorator with the name "Col". Please publish your decorator.
Posted by Mickael Monsieur (mickaelmonsieur) on 2011-04-05T08:24:30.000+0000
' . $mess . ''; } return $return; } public function buildDescription() { $element = $this->getElement(); $desc = $element->getDescription(); if (empty($desc)) { return ''; } return '' . $desc . ''; } public function render($content) { $element = $this->getElement(); if (!$element instanceof Zend_Form_Element) { return $content; } if (null === $element->getView()) { return $content; } $separator = $this->getSeparator(); $placement = $this->getPlacement(); $label = $this->buildLabel(); $input = $this->buildInput(); $errors = $this->buildErrors(); $desc = $this->buildDescription(); if(!empty($errors)) $errorClass = " formRed"; else $errorClass = ""; if(!empty($this->_options) && isset($this->_options['class'])) $class = ' '.$this->_options['class']; else $class=''; if(!empty($this->_options) && isset($this->_options['id'])) $id = ' id="'.$this->_options['id'].'"'; else $id=''; if(!empty($this->_options) && isset($this->_options['style'])) $style = ' style="'.$this->_options['style'].'"'; else $style=''; if($element instanceof Zend_Form_Element_MultiCheckbox){ $inputr = ''; $inputr .= $input; $inputr .= ''; $input = $inputr; } if($element instanceof Zend_Form_Element_Submit || $element instanceof Zend_Form_Element_Button){ $output = '' . ' ' . $input . '' . ''; }elseif($element instanceof Zend_Form_Element_Checkbox && (isset($this->_options['type']) && $this->_options['type']=='term')){ $output = '' . '' . ''.$input.' '.$element->getLabel().'' . '' . $errors . '' . ''; }else{ $output = '' . ''.$label.'' . ''.$input.'' . $desc . $errors . '' . ''; } switch($placement) { case (self::PREPEND): return $output . $separator . $content; case (self::APPEND): default: return $content . $separator . $output; } } }Posted by Kai Uwe (kaiuwe) on 2011-04-05T09:49:34.000+0000
This is a bug in your decorator and not in the framework!
Please check the default decorators:
Or look a the API-Doc: [http://framework.zend.com/apidoc/core/…]
Posted by Kai Uwe (kaiuwe) on 2011-04-05T09:54:13.000+0000
For a error in the documentation open a new issue. Thanks.
[http://framework.zend.com/manual/en/…]