Home  >  Article  >  PHP Framework  >  Yii2.0 implements hiding the label label in the form

Yii2.0 implements hiding the label label in the form

王林
王林Original
2019-12-24 14:54:483162browse

Yii2.0 implements hiding the label label in the form

Hide tag method one:

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

Hide tag method two:

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

Hide tag method three:

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

Supplement:

Default normal method:

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

Modify tag content

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

Recommended related article tutorials: yii tutorial

The above is the detailed content of Yii2.0 implements hiding the label label in the form. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn