gpt4 book ai didi

Cakephp3 : Render/Evaluate HTML inside label formhelper

转载 作者:行者123 更新时间:2023-12-02 12:49:45 26 4
gpt4 key购买 nike

如何在 cakephp3 中将 html 放置在标签内?

我需要实现* 姓名:

使用下面的代码

<?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
] );

最佳答案

与往常一样,使用 escape option .

echo $this->Form->input('name', [ 
'label' => [
// ...
'escape' => false
],
// ...
]);

关于Cakephp3 : Render/Evaluate HTML inside label formhelper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27991447/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com