简体   繁体   中英

Zend Framework Checkbox Decorators

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'))

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

I know that is an older question, but you can also use

$element->getDecorator('label')->setOption('placement', 'APPEND');

if it is an already created element with an existing decorator

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM