title: Multiple values in one field Yii2
body: <p>How to display multpiple values in one field.. I Use Select2 Widget. If i use $courses_model[0] it display only one value</p>
  
  <p>Controller</p>
  
  <pre><code>public function actionUpdateteachers($id)
  {
      $courses_model = ReferenceTeachersCourses::find()-&gt;where(['reference_teachers_id' =&gt; $id])-&gt;all();
      .....
   }
  </code></pre>
  
  <p>View</p>
  
  <pre><code>...
  &lt;?= $form-&gt;field($courses_model[0], 'reference_course_type_id')-&gt;widget(Select2::classname(), [
      'data' =&gt;ArrayHelper::map($courses,'id','name'),
      'options' =&gt; ['multiple' =&gt; true],
      'pluginOptions' =&gt; [
          'allowClear' =&gt; true,
      ],
  ]);
  ...
  ?&gt;
  </code></pre>