public function render() { $comments = $this->article->getComments(); $this->template->comments = $comments->slice($this->paginator->getOffset(), $this->paginator->getLength()); $this->template->setFile(__DIR__ . '/templates/comments.latte'); $total = count($this->article->getComments()); $this->paginator->setItemCount($total); $this->template->paginator = $this->paginator; $this->template->render(); }