A
A
agent11562016-09-14 14:21:08
Yii
agent1156, 2016-09-14 14:21:08

How in yii2 does one form element have its own class?

How to set the class col-md-2 to an element?
<?= $form->field($model, 'title')->dropDownList(\yii\helpers\ArrayHelper::map(\app\models\Organizat::find()->all(), 'id' , 'name')) ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VitGun, 2016-09-14
@VitGun

Something like this.

<?= $form->field($model, 'title')->dropDownList(\yii\helpers\ArrayHelper::map(\app\models\Organizat::find()->all(), 'id', 'name',['class'=>'col-md-2'])) ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question