Cakephp3:渲染/评估标签formhelper中的HTML [英] Cakephp3: Render/Evaluate HTML inside label formhelper
本文介绍了Cakephp3:渲染/评估标签formhelper中的HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将HTML放置在cakephp3的标签内?
How you place html inside label in cakephp3?
我需要实现*名称:
使用下面的代码
<?php
echo $this->Form->input ( 'name', [
'label' => [
'text' => '<span class="red">*</span> Name:',
'class' => 'col-sm-12 col-md-2 col-lg-1 control-label'
],
'class' => 'form-control',
'rows' => 1
] );
推荐答案
Pretty much as always, use the escape
option.
echo $this->Form->input('name', [
'label' => [
// ...
'escape' => false
],
// ...
]);
这篇关于Cakephp3:渲染/评估标签formhelper中的HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文