yii2单独给input或者其他标签定义class

时间:2022-08-04 13:47:02

<?= $form->field($model, 'price5', ['options' => ['class' => 'col-sm-6']])->textInput()->label('价格5') ?> //写在field里面会追加到Input父级

<?= $form->field($model, 'price5')->textInput([class' => 'col-sm-6'])->label('价格5') ?> //写在textInput会追加Input

相关文章