title: Yii2 dropdown multiple selected values
body: <p>I used Yii2 multiple selection dropdown , it is working fine at create but not showing me selected values on update!</p>
  
  <p>Form:</p>
  
  <pre><code>       $form-&gt;field($model, 'categories[]')            
           -&gt;dropDownList($model-&gt;CategoryDropdown,
           [
            'multiple'=&gt;'multiple'
            'class'=&gt;'chosen-select input-md required',              
           ]             
          )-&gt;label("Add Categories");    
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>public function getCategoryDropdown()
  {
          $listCategory   = Category::find()-&gt;select('ID,name')
              -&gt;where(['is_subcategory' =&gt; 'Yes'])
              -&gt;andWhere(['status' =&gt; 'active','approved' =&gt; 'active'])
              -&gt;all();
          $list   = ArrayHelper::map( $listCategory,'ID','name');
  
          return $list;
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code> public function actionCreate(){
   ...
       $model-&gt;categories = implode(",",$_POST['Company']['categories']);
      ...
      return $this-&gt;render('create', [
              'model' =&gt; $model,           
          ]);
   }
  
  public function actionUpdate($id)
  {
      $model = $this-&gt;findModel($id);    
  
      echo $model-&gt;categories; //  1,2,4,5  values already assigned
      ...
      return $this-&gt;render('update', [
                  'model' =&gt; $model,                    
              ]); 
    }
  </code></pre>
  
  <p>Database:</p>
  
  <p>1,2,4,5</p>
  
  <p>How I can show multi selected values in dropdown when I update my recored?</p>