I just moved to Yii2. How to make text box like this:
<?= $form->field($model, 'xxx') ?>
but without using any model?
Use yii\helpers\Html
and
Try something like,
<?= Html::textInput('xxx', value, options[]); ?>
textInput()
I would add a label and the form-control
Bootstrap class:
<?= Html::label('Person', 'xxx') ?>
<?= Html::textInput('xxx', value, ['class' => 'form-control']) ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With