Пример #1
0
 public function actionIndex($id)
 {
     $user = User::findIdentity($id);
     $comments = Comment::getRecentComments();
     $sidebarCategories = Category::getSidebarCategories();
     $tags = Tag::getTagList();
     return $this->render('index', ['user' => $user, 'comments' => $comments, 'sidebarCategories' => $sidebarCategories, 'tags' => $tags]);
 }
Пример #2
0
 /**
  * Displays homepage.
  *
  * @return mixed
  */
 public function actionIndex()
 {
     $query = Page::find()->where(['live' => 1]);
     $pagination = new Pagination(['defaultPageSize' => 2, 'totalCount' => $query->count()]);
     $pages = $query->offset($pagination->offset)->limit($pagination->limit)->all();
     $comments = Comment::getRecentComments();
     $sidebarCategories = Category::getSidebarCategories();
     $tags = Tag::getTagList();
     return $this->render('index', ['pages' => $pages, 'pagination' => $pagination, 'comments' => $comments, 'sidebarCategories' => $sidebarCategories, 'tags' => $tags]);
 }