Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $data = [];
- $query = Blog::find()->where(['status'=>1])->multilingual()->orderBy(['id'=>SORT_DESC])->all();
- $count = count($query);
- $pagination = new Pagination(['totalCount' => $count]);
- // limit the query using the pagination and retrieve the articles
- $data['blog'] = $query->offset($pagination->offset)->limit($pagination->limit)->all();
- return $this->render('blog-list',['data'=>$data, 'pagination'=>$pagination]);
Add Comment
Please, Sign In to add comment