问题
How you place html inside label in cakephp3?
I need to achieve * Name:
using the code below
<?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
] );
回答1:
Pretty much as always, use the escape option.
echo $this->Form->input('name', [
'label' => [
// ...
'escape' => false
],
// ...
]);
来源:https://stackoverflow.com/questions/27991447/cakephp3-render-evaluate-html-inside-label-formhelper