Codxplore.com

Latest news:

New android application Islamic Video has been released. its a free islamic video application for android smartphone. Download now!

Yii2 Relation Model


Relation Model

$model = User::find()
        ->with('comments')
        ->all();
    foreach ($model as $user) {
        // get data from relation model
        $comments = $user->comments;
        ......
        foreach($comments as $comment){
            ........
        }
    }

Tags : PHP, Yii2,

Views : 1238

Subscribe Us


Follow Us