我想知道如何在 Form Checkbox Element 标签上禁用转义?
我想要我的标签 html,这是我当前的代码:
$score = new \Zend\Form\Element\MultiCheckbox('score');
$score->setLabel('Score');
$score->setOptions(array('value_options' => array(1 => '<b>Test 1</b>', 2 => '<b>Test 2</b>')));
$score->setAttributes(array('escape' => false));
$this->add($score);
最佳答案
$score->setLabelOptions(array('disable_html_escape' => true));
关于zend-framework2 - Zend Framework 2 表单元素标签无转义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18173511/