Zend Framework 2表单元素标签无逃脱

Sio*_*iol 3 zend-framework2

我想知道如何在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);
Run Code Online (Sandbox Code Playgroud)

小智 7

 $score->setLabelOptions(array('disable_html_escape' => true));
Run Code Online (Sandbox Code Playgroud)