Zend_Form :: setElementDecorators $ elements param并没有什么区别

时间:2010-12-19 07:06:26

标签: zend-framework zend-form zend-decorators

来自文档...

  

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标志为false。两者似乎没有什么区别。所有元素的样式都相同,标签为

1 个答案:

答案 0 :(得分:0)

$sumbit ->removeDecorator('label');