本文介绍了Zend框架复选框装饰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我现在正在使用这些装饰器: / p>

  private $ checkboxDecorators = array(
Label,
array(array('data'=> HtmlTag'),array('tag'=>'div','class'=>'checkbox')),
'ViewHelper',
array(array('row'=& 'HtmlTag'),array('tag'=>'li')),
);

我试着切换Label和ViewHelper装饰器,但什么也没做。任何建议?

解决方案
  $ this-> getElement('elementId') - > ; addDecorator('Label',array('placement'=>'APPEND'))

展示位置选项可以将APPEND或PREPEND作为值


What I am trying to accomplish is to have checkbox labels display after checkbox input fields (to the right of them).

I am using these decorators now:

private $checkboxDecorators = array(
    Label,
    array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'checkbox')),
    'ViewHelper',
    array(array('row' => 'HtmlTag'), array('tag' => 'li')),
);

I have tried switching the Label and ViewHelper decorators but that did nothing. Any suggestions?

解决方案
$this->getElement('elementId')->addDecorator('Label', array('placement' => 'APPEND'))

the placement option can take APPEND or PREPEND as value

这篇关于Zend框架复选框装饰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 06:47