public function actionIndex(){
$query = Article::getArticleDesc();
$data = $this->cacheGet('artIndex');
if ($data === false) {
$pages = new Pagination([
'totalCount' => $query->count(),
'pageSize' => 20,
'forcePageParam' => false,
'pageSizeParam' => false
]);
$articles = $query->offset($pages->offset)->limit($pages->limit)->all();
$this->cacheSet('artIndex', $articles, 10000);
return $this->render('index', compact('articles', 'pages'));
}
$pages = new Pagination([
'totalCount' => $query->count(),
'pageSize' => 20,
'forcePageParam' => false,
'pageSizeParam' => false
]);
$articles = $query->offset($pages->offset)->limit($pages->limit)->all();
return $this->render('index', compact('articles', 'pages'));
}