ZF-5608: [CLOSEME] No way to pass ListSep parameter to Zend_View_Helper_FormMultiCheckbox
Description
When rendering multiCheckboxes or radio, the list separator is defined in function itself, not {{$options}} array.
It makes it impossible to use {{Zend_Form_Element_Multi}} with custom separator (instead of default {{
\n}}.
In class {{Zend_View_Helper_FormMultiCheckbox}}
public function formMultiCheckbox($name, $value = null, $attribs = null,
$options = null, $listsep = "
\n")
{
return $this->formRadio($name, $value, $attribs, $options, $listsep);
}
The {{$listsep}} should be part of {{$options}}. It should be then propagated to {{Zend_View_Helper_FormRadio}}.
The reason for this is {{Zend_Form_Decorator_ViewHelper::render()}} calls the View helper in the following way:
// Zend/Form/Decorator/ViewHelper.php : 241
$elementContent = $view->$helper($name, $value, $attribs, $element->options);
The rest of optional function parameters will never be called.
Comments
Posted by Artur Bodera (joust) on 2009-01-22T04:41:32.000+0000
Well, apparently {{$element->setSeparator()}} does the trick. I was too deep in the code to notice that. A bit quirky, but works.
Posted by Matthew Weier O'Phinney (matthew) on 2009-01-22T05:06:55.000+0000
Closing per request from reporter.