【发布时间】:2010-12-19 07:06:26
【问题描述】:
来自文档...
Zend_Form setElementDecorators ( $decorators, [$elements = null], [bool $include = true])
array $decorators array|null $elements: Specific elements to decorate or exclude from decoration bool $include: Whether $elements is an inclusion or exclusion list
我想为我的大部分元素重复使用相同的装饰器......但不是提交按钮......我试过了
...
$this->addElement('submit', 'btnSubmitProject', array(
'label' => 'Add Project',
'ignore' => true
));
$this->setElementDecorators(
array(
'ViewHelper',
'Errors',
'Label'
),
array(
'btnSubmitProject', 'submit' // I think I should be using the 1st (btnSubmitProject) but I have 'submit' just to be sure
),
true // and false
);
我为$include 标志尝试了真假。两者似乎都没有区别。所有元素的样式都相同,带有标签
【问题讨论】:
-
您不需要在
$elements数组中添加第二个元素。
标签: zend-framework zend-form zend-decorators