ZF-5608: [CLOSEME] No way to pass ListSep parameter to Zend_View_Helper_FormMultiCheckbox


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 {{

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.


Well, apparently {{$element->setSeparator()}} does the trick. I was too deep in the code to notice that. A bit quirky, but works.

Closing per request from reporter.