Yii Framework Forum: Generate ActiveField form-group-with ID - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Generate ActiveField form-group-with ID

#1 User is offline   jwerner 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 04-December 08
  • Location:Germany

Posted 16 April 2018 - 07:41 AM

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 ...) ) an id attribute.
Adding ['id'=>...] to the field method throws an error.

How can I do this?

Thanks in advance.

Regards
Joachim
0

#2 User is offline   umneeq 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 205
  • Joined: 10-October 11
  • Location:Russia

Posted 16 April 2018 - 11:40 AM

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

0

#3 User is offline   jwerner 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 04-December 08
  • Location:Germany

Posted Today, 02:23 AM

View Postumneeq, on 16 April 2018 - 11:40 AM, said:

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



Thanks, it worked... that simple!

Regards
Joachim



0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users