コード例 #1
0
ファイル: HomepagePresenter.php プロジェクト: krupaj/my-blog
 public function renderDefault()
 {
     $total = $this->articleRepository->countPublishedArticles();
     $limits = ['limit' => $this->paginator->getLength(), 'offset' => $this->paginator->getOffset()];
     $this->template->news = $this->articleRepository->findPublishedArticles($limits);
     $this->paginator->setItemCount($total);
     $this->template->paginator = $this->paginator;
     $this->template->dPosts = $this->articleRepository->getMostDiscussedArticles();
     $this->template->rPosts = $this->articleRepository->getMostReadedArticles();
     $this->template->nPosts = $this->articleRepository->getRandArticles();
 }