0

Using this code:

<?= $form->field($model, 'username') ?>

would return a specific HTML containing a set of divs, text etc. enter image description here

Let's say I don't want to print out the label "Username" Above the input field, and maybe I want to add some HTML code for this input (maybe a div next to the input field..) what is the best way to do this?

Do I need to edit the class/file that is actually responsible for the output of this function?

Danila Ganchar
  • 10,266
  • 13
  • 49
  • 75
MeV
  • 3,761
  • 11
  • 45
  • 78

1 Answers1

0

The field above the 'username' is label you can change it by chaining lable() function

<?php $form->field($model, 'username')->textInput()->label('Add your lable here') ?>

Please click this link for more detail

Nabin Kunwar
  • 1,965
  • 14
  • 29