开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜