开发者

is it possible to create subform and displaygroup without fieldset on zend forms?

开发者 https://www.devze.com 2022-12-24 19:15 出处:网络
is开发者_C百科 it possible to create subform and displaygroup without fieldset on zend forms?Yes it is possible.

is开发者_C百科 it possible to create subform and displaygroup without fieldset on zend forms?


Yes it is possible.

You can override the loadDefaultDecorators Zend_Form original method in your particular form like this:

public function loadDefaultDecorators() {
    parent::loadDefaultDecorators();

    // remove the 'fieldset' decorator from all subforms
    $subforms = $this->getSubForms();
    foreach($subforms as $subform) {
        $subform->removeDecorator('Fieldset');
    }

    return $this;
}

This may be helpful when you load subforms dynamically, based on e.g a selected option from a select list. Hope this will help someone.


Why to do this?
This is helpful accessibility feature?

However, You may do this in many ways, e.g. subclassing Zend_Form and setting your own decorators, or using getDecorators(), addDecorator() setDecorators() or removeDecorator() methods.

0

精彩评论

暂无评论...
验证码 换一张
取 消