【发布时间】:2012-02-02 14:04:05
【问题描述】:
我使用我的班级来改变我的表格的装饰。 换句话说,而不是调用
Application_Form_Login extends Zend_Form
我用:
Application_Form_Login extends My_Form
在我的“My_Form”类中,我定义了以下内容:
protected $_disableLoadDefaultDecorators = true;
protected $_elementDecorators = array(
'ViewHelper',
array(
'Errors',
array(
'data-icon'=>"alert",
'class'=>"ui-body ui-body-e errors"
)
),
'Label',
array(
array(
'row' => "HtmlTag"
), array(
'tag'=>"div",
'data-role'=>"fieldcontain"
)
)
);
这在我的常规表单上非常有效。 但是一旦我使用 jQuery 表单:
$this->addElement(new ZendX_JQuery_Form_Element_AutoComplete(
"ac1",
array('label' => "Your Address:"))
));
它对它们没有影响,它们仍然使用默认的装饰器进行渲染。 任何想法如何为 jQuery 表单元素全局设置装饰器?
【问题讨论】:
标签: zend-framework zend-form zend-decorators