Generate ActiveField form-group-with ID


(Joachim Werner) #1

Hello,

I am generating a form field by using




use yii\bootstrap\ActiveForm;

<?= $form->field($model, 'synopsis')->textarea(['rows' => 4]) ?>



I nedd to give the outer div (<div class="form-group …) )[size="2"] an id attribute.[/size]

[size=“2”]Adding [‘id’=>…] to the field method throws an error.[/size]

[size="2"]How can I do this?[/size]

[size="2"]Thanks in advance.[/size]

[size="2"]Regards[/size]

[size="2"]Joachim[/size]


(4ernikoff) #2

<?= $form->field($model, 'synopsis', ['options' => ['class' => 'form-group', 'id' => 'blabla']]) ?>


(Joachim Werner) #3

Thanks, it worked… that simple!

Regards

Joachim