Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public function actionIndex()
 {
     $query = Content::leftJoinWith('takonomy');
     $locals = LuLu::getPagedRows($query, [
         'orderBy' => 'created_at desc', 
         'pageSize' => 6
     ]);
     
     return $this->render('index', $locals);
 }