public function actionIndex() { $query = Content::leftJoinWith('takonomy'); $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => 6]); $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 5]]); $locals['dataProvider'] = $dataProvider; return $this->render('index', $locals); }
public static function getPagedContents($where = null, $pageSize = 10) { $query = Content::leftJoinWith('taxonomy'); if (!empty($where)) { $query->andWhere($where); } $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => $pageSize]); return $locals; }
public function actionIndex() { $query = Content::leftJoinWith('takonomy'); $locals = LuLu::getPagedRows($query, [ 'orderBy' => 'created_at desc', 'pageSize' => 6 ]); return $this->render('index', $locals); }