首页  >  文章  >  php框架  >  yii2.0实现隐藏form中的label标签

yii2.0实现隐藏form中的label标签

王林
王林原创
2019-12-24 14:54:483203浏览

yii2.0实现隐藏form中的label标签

隐藏标签方式一:

<?= $form->field($model, &#39;ee_type&#39;, [&#39;labelOptions&#39;=>[&#39;class&#39;=> &#39;hide&#39;]])->dropDownList(YiiLib::loadDDList())?>

隐藏标签方式二:

<?= $form->field($model, &#39;ee_type&#39;)->dropDownList(YiiLib::loadDDList())->label(false) ?>

隐藏标签方式三:

<?= $form->field($model, &#39;ee_type&#39;, [&#39;options&#39;=>[&#39;class&#39;=>&#39;hide&#39;]])->dropDownList(YiiLib::loadDDList()) ?>

补充:

默认常规方式:

<?= $form->field($model, &#39;ee_type&#39;)->dropDownList(YiiLib::loadDDList()) ?>

修改标签内容

<?= $form->field($model, &#39;ee_type&#39;)->dropDownList(YiiLib::loadDDList())->label(&#39;Welcome To 
<small>YiiLib.com </small>&#39;) ?>

相关文章教程推荐:yii教程

以上是yii2.0实现隐藏form中的label标签的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn