public function renderDefault()
{
$articles = $this->articlesDao->fetch(new ArticlesQuery());
$articles->applyPaginator($this['vp']->paginator);
$this->template->articles = $articles;
}
protected function createComponentVp()
{
return new VisualPaginator;
}
.
It automatically counts the query, passes the count of results to paginator
and then reads the offset from paginator and applies it to the query so you get the correct results.