title: Trying to get dropdown menu with values from database but getting array to string conversion error (YII2)
body: <p>This is my code:</p>
  <pre><code>&lt;?= 
      $rates= ApplicantRating::find()-&gt;all();     
      $listData= \yii\helpers\ArrayHelper::map($rates,'id','name'); 
      
      echo $form-&gt;field($model,'name')-&gt;dropDownList($listData,['prompt'=&gt;'Select...']);
  ?&gt;
  </code></pre>
  <p>I have a:</p>
  <blockquote>
  <p>PHP Notice – yii\base\ErrorException Array to string conversion error</p>
  </blockquote>
  <p>and I cannot understand why. It is highlighting the line <code>$rates= ApplicantRating::find()-&gt;all();</code> as the problem. Any suggestions pls?</p>
  <p>Thanks a lot.</p>