formsyiiyii2yii-widgets

Hide label for input field


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

and alternate code:

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

What is the right approach to hide a label?


Solution

  • Ok, I found the solution.

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