title: Yii2 activequery display data to view
body: <p>I want to query data from specific table from database and display it in my view.</p>
  
  <p>From my Controller function.</p>
  
  <pre><code> public function actionViewPds()
  { 
      //$model = new User();
      $query= new \yii\db\Query;
      $provider=new  ArrayDataProvider([
        'allModels'=&gt;$query-&gt;from('{{%tbl_family_background}}')-&gt;orderBy('[[nfamily_id]]')-&gt;all(),
      ]);
  
      return $this-&gt;render('view-pds',[
        'model' =&gt; $provider,
      ]);
  }
  </code></pre>
  
  <p>And in my view, where I want to display the data.</p>
  
  <pre><code>&lt;?php $model-&gt;nfamily_id;?&gt;
  </code></pre>
  
  <p>and my error </p>
  
  <pre><code>Unknown Property – yii\base\UnknownPropertyException
  </code></pre>
  
  <p>Getting unknown property: yii\data\ArrayDataProvider::nfamily_id</p>