title: Yii2 DepDrop kartik
body: <p>Ok I am trying to use the Kartik Depdrop widget, but get this error <strong>500 (Internal Server Error)</strong></p>
  
  <p>i have parent model Brand and submodel CarModel </p>
  
  <p>Here are my files:</p>
  
  <p><strong>CarsController.php</strong> </p>
  
  <pre><code>public function actionSubcat() {
      $out = [];
      if (isset($_POST['depdrop_parents'])) {
          $parents = $_POST['depdrop_parents'];
          if ($parents != null) {
              $cat_id = $parents[0];
              $out = self::getSubCatList($cat_id);
              // the getSubCatList function will query the database based on the
              // cat_id and return an array like below:
              // [
              //    ['id'=&gt;'&lt;sub-cat-id-1&gt;', 'name'=&gt;'&lt;sub-cat-name1&gt;'],
              //    ['id'=&gt;'&lt;sub-cat_id_2&gt;', 'name'=&gt;'&lt;sub-cat-name2&gt;']
              // ]
              echo Json::encode(['output'=&gt;$out, 'selected'=&gt;'']);
              return;
          }
      }
      echo Json::encode(['output'=&gt;'', 'selected'=&gt;'']);
  }
  </code></pre>
  
  <p>model <strong>Cars.php</strong></p>
  
  <pre><code>public function getSubCatList($cat_id)
  {
      $data=\common\models\CarModel::find()
         -&gt;where(['brand_id'=&gt;$cat_id])
         -&gt;select(['id','name_ru AS name' ])-&gt;asArray()-&gt;all();
  
      return $data;
  
  }
  </code></pre>
  
  <p>and my viw file </p>
  
  <pre><code>&lt;?php $catList = ArrayHelper::map(Brand::find()-&gt;all(),'id','name_ru'); ?&gt;
  
  &lt;?=  $form-&gt;field($model, 'brand_id')-&gt;dropDownList($catList, 
      [
          'prompt' =&gt; 'Select brand',
          'id'=&gt;'brand_id-id'
      ]);
  ?&gt;
  
  &lt;?=$form-&gt;field($model, 'car_model_id')-&gt;widget(DepDrop::classname(), [
           'options' =&gt; ['id'=&gt;'car_model_id-id'],
           'pluginOptions'=&gt;[
               'depends'=&gt;['brand_id-id'],
               'placeholder' =&gt; 'Select...',
               'url' =&gt; Url::to(['subcat'])
          ]
      ]);
  
  ?&gt;
  </code></pre>
  
  <p>what is my mistake?</p>