title: How to set selected or default value in select2 yii2?
body: <p>How to set selected or default value in select2 yii2?
  i've tried using <code>'value' =&gt; $myvalue</code> and <code>'initValue' =&gt; $myValue</code></p>
  
  <p>Is there any solution? Thank You.</p>
  
  <p>I've just found solution.
  here if you want to set default value or selected value for select :</p>
  
  <pre><code>&lt;?php $model-&gt;group = yourdefaultValue ?&gt;
  &lt;?=$form-&gt;field($model, 'group')-&gt;label('Group Name')-&gt;widget(Select2::classname(),
  [
       'data' =&gt; ArrayHelper::map(Group::find()-&gt;all(),'id','name', 'kategori'),
       'options' =&gt; ['placeholder' =&gt; 'Select Phone Number'],
       'pluginOptions' =&gt; [
             'allowClear' =&gt; true,
             'minimumInputLength' =&gt; 2,
       ],
  ]);
  ?&gt;
  </code></pre>