1

Here's my code where I want to place fa fa icon in that.

Whenever I place <i class=fa fa-user></i> it not display anything and it runs without error's.

<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
<?= $form->field($model, 'username') ?>

<?= $form->field($model, 'password')->passwordInput() ?>
<?= $form->field($model, 'rememberMe')->checkbox() ?>
Grimthorr
  • 6,856
  • 5
  • 41
  • 53
Shailesh Yadav
  • 205
  • 3
  • 12

2 Answers2

2

try this in your login view

 $fieldOptions3 = [
        'options' => ['class' => 'form-group has-feedback'],
        'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
    ];
    <?= $form->field($model, 'password', $fieldOptions3)->label('Password')->passwordInput() ?>
Goli
  • 436
  • 5
  • 19
0

<?= $form->field($model, 'username')->textInput(['maxlength' => 255, 'class' => 'glyphicon glyphicon-lock']) ?>

Kyle
  • 667
  • 6
  • 28