This is the activeform field. I would like to know how to add a css class to it.
<?= $form->field($model, 'url')->label(false); ?>
You can add it with
<?= $form->field($model, 'url')->textInput(['maxlength' => 255, 'class' => 'your class'])->label(false); ?>
As a rule you can pass html elements when telling activeField what type it should be. The default is textInput so that is why your code works, but if you want to change the input then you have to explicitly tell it the type of input.
http://www.yiiframework.com/doc-2.0/guide-input-forms.html
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