How can I set "removeDecorators()" while using only 'options' from
Zend_Form? Why is it not possible like in CSS to overwrite decorators? With
this code, it may possible to show labels for all elements except for the
submit button.

$form = new Zend_Form(array(
    'action' => '/user/register',
    'method' => 'post',
    'elements' => array(
        'submit' => array(
            'submit',
            'decorators' => array( // overwrites elementDecorators because
the scope is nearer to the element
                'ViewHelper',
            ),
        ),
    ),
    elementDecorators => array(
        'Label',
        'ViewHelper',
        array('HtmlTag', array('tag' => 'li')),
    ),
);


Regards,
Dennis

PS: Please set me CC because I'm not a subscriber of the mailing list.

2008/2/19, Matthew Weier O'Phinney <[EMAIL PROTECTED]>:

> I'm guessing you must be using setElementDecorators(). :-)
>
>  Yes, there's an easy way to remove a decorator:
>
>     $form->submit->removeDecorator('Label');
>
>  will remove the Label decorator.
>
>  (BTW, Button, Reset, and Submit elements no longer use the Errors and
>  Label decorators currently, as they're typically unnecessary.)
>
>
>  --
>  Matthew Weier O'Phinney
>  PHP Developer            | [EMAIL PROTECTED]
>  Zend - The PHP Company   | http://www.zend.com/

Reply via email to