隐藏输入字段的标签 [英] Hide label for input field

查看:108
本文介绍了隐藏输入字段的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在_form.php中隐藏特定字段的标签,但没有成功.

I am trying to hide the label for a specific field in _form.php without success.

我尝试了几种变体,但没有一个起作用:

I have tried couple of variation like, but none is working:

<?= $form->field($model, 'sample_text')->textArea('label'=>false) ?>

和备用代码:

<?= $form->field($model, 'sample_text')->textArea('label'=>'') ?>

隐藏标签的正确方法是什么?

What is the right approach to hide a label?

推荐答案

好,我找到了解决方法.

Ok, I found the solution.

<?= $form->field($model, 'sample_text')->textArea()->label(false) ?>

这篇关于隐藏输入字段的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆