title: How to get value from Yii2 ActiveQuery array
body: <p>I have a table containing fields </p>
  
  <pre><code>id, vehicle_id, vehicle_rating_type, vehicle_rating, rating_time
  </code></pre>
  
  <p>I want to get values based in <code>vehicle_id</code>, so I fired query</p>
  
  <pre><code>$id = Yii::$app-&gt;getRequest()-&gt;getQueryParam('id');
  $data = VehicleRating::find()-&gt;where(['vehicle_id' =&gt; $id]);
  </code></pre>
  
  <p>Now when I prints <code>$data</code> array in view file using <code>print_r</code> function I get following result.</p>
  
  <pre><code>yii\db\ActiveQuery Object ( 
      [sql] =&gt; 
      [on] =&gt; 
      [joinWith] =&gt; 
      [select] =&gt; 
      [selectOption] =&gt; 
      [distinct] =&gt; 
      [from] =&gt; 
      [groupBy] =&gt; 
      [join] =&gt; 
      [having] =&gt; 
      [union] =&gt; 
      [params] =&gt; Array ( ) 
      [_events:yii\base\Component:private] =&gt; Array ( ) 
      [_behaviors:yii\base\Component:private] =&gt; Array ( ) 
      [where] =&gt; Array ( 
          [vehicle_id] =&gt; 1 
      ) 
      [limit] =&gt; 
      [offset] =&gt; 
      [orderBy] =&gt; 
      [indexBy] =&gt; 
      [modelClass] =&gt; backend\models\VehicleRating 
      [with] =&gt; 
      [asArray] =&gt; 
      [multiple] =&gt; 
      [primaryModel] =&gt; 
      [link] =&gt; 
      [via] =&gt; 
      [inverseOf] =&gt; 
  )
  </code></pre>
  
  <p>How to retrive values from this array to show in view file? Say I want to say <code>vehicle_id</code> and <code>vehicle_rating</code>. How to print it?</p>