I have a Category model that has a relation with the Products model. I am doing the following query:
$model = Category::find()->where(['slug' => $slug])->with('products')->one();
And in the view I can retrieve all the products that belong to that Category with:
foreach ($model->products as $value)...
Now I want to do the pagination in the products but I can not find how to do it in the "with" part of the query.