php - Yii2 Pass multiple SQL row result to view

one text

Solution:

You are missing the call to the all() method that will return the models from the query:

 foreach($totalpubperorg->all() as $tppo){
     var_dump($tppo);
 }

Just give a look at official documentation: Querying data

Source