2008年8月27日星期三

Re: [fw-mvc] viewHelper only decorator for Zend_Form_Element_MultiCheckbox

-- Václav Vaník <vanik@walk.cz> wrote
(on Wednesday, 27 August 2008, 06:41 AM -0700):
> I want to render multicheckbox with view helper only (no label decorator)
>
> my form is:
>
> $form = new Zend_Form();
> $multi = $form->createElement('multiCheckbox', 'foo');
> $form->addElement($multi)->setElementDecorators(array('ViewHelper'));
>
> and rendered checkbox is inside label
>
> I tried:
>
> $multi = $form->createElement('multiCheckbox', 'foo');
> $multi->setDecorators(array('ViewHelper'));
>
> but result is with label :(

MultiCheckbox generates labels for each checkbox -- this is not part of
decoration, but generated via the view helper itself.

You can create your own MultiCheckbox view helper to drop in as a
replacement if you need to customize the HTML output.

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: