0

<?php echo $this->formMultiCheckbox($this->form->options->getFullyQualifiedName(), $this->form->options->getValue(), null, array('1' => $this->form->options->getMultiOption('1'))); ?>

我有这样的东西,我想给它添加一个 CSS 类。我怎么能用这个助手做到这一点?

谢谢

4

1 回答 1

1

使用第三个参数 ( $attribs) 传递类名:

<?php echo
$this->formMultiCheckbox($this->form->options->getFullyQualifiedName(), 
$this->form->options->getValue(), array('class' => 'myclass'), array('1' =>
$this->form->options->getMultiOption('1'))); ?>

这会将 html 属性添加class="myclass"到复选框。

于 2012-06-10T22:32:30.727 回答