Answer the question
In order to leave comments, you need to log in
How to do data output interleaving?
base1::find()->all();
base2::find()=>all();
And here html view
base1->title
base2->title
How to properly set up a cycle?
Answer the question
In order to leave comments, you need to log in
for example like this:
$arr = [];
$arr[] = MyModelOne::find()->limit(20)->asArray()->all();
$arr[] = MyModelSecond::find()->limit(20)->asArray()->all();
for($i = 0; $i < 20; $i++){
if(isset($arr[0][$i]['title']) and isset($arr[1][$i]['title'])){
echo $arr[0][$i]['title'];
echo $arr[1][$i]['title'];
}else{
break;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question