in my zend form i set decarators to each element , instead of that can i set single decorater that can applicable to all.
currently ..
$code = new Zend_Form_Element_Text("mealplancode");
$code->setLabel("Code :");
$code->setDecorators(
array(
array('ViewHelper',
array('helper' => 'formText')
),
array('HtmlTag',
array('tag' => 'div', 'class' => '')
),
array('Label',
array('class' => 'label')
),
)
);
$name = new Zend_Form_Element_Text("mealplanname");
$name->setLabel("Name :");
$name->setDecorators(
array(
array('ViewHelper',
array('helper' => 'formText')
),
array('HtmlTag',
array('tag' => 'div', 'class' => '')
),
array('Label',
array('class' => 'label')
),
)
);
i want to set decorators to both $name and $code in a single setDecorator()
can i do this
In your form class define a decorator field to be able to apply it to any form element, e.g.:
And like in your code you can set the decorator: