如何编辑(ZF2形式的)Button元素的按钮内容?我可以设置标签,但是我想在其中插入一些html代码。
$this->add(array(
'type' => 'Button',
'name' => 'submit',
'options' => array(
'label' => 'Modifica',
),
'attributes' => array(
'type' => 'submit',
'class' => 'btn btn-warning'
)
));
谢谢
您可以简单地使用disable_html_escape标签的选项。这个对我有用。
$this->add(array(
'type' => 'Button',
'name' => 'submit',
'options' => array(
'label' => '<i class="icon icon-foo"></i> Submit',
'label_options' => array(
'disable_html_escape' => true,
)
),
'attributes' => array(
'type' => 'submit',
'class' => 'btn btn-success'
)
));
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句