public function render() { $template = $this->getTemplate(); $template->setFile(__DIR__ . '/templates/template.latte'); if ($this->presenter->getParameter('month') !== null) { $this->template->date = new \DateTime($this->presenter->getParameter('year') . '-' . $this->presenter->getParameter('month') . '-01'); } $template->heading = $this->heading; $template->numberOfListings = isset($this->listings) ? Arrays::count_recursive($this->listings, 1) : 0; $template->listings = $this->listings; $template->render(); }
public function render() { $template = $this->getTemplate(); $template->setFile(__DIR__ . '/templates/template.latte'); if ($this->listingsQuery->getMonth() !== null) { $this->template->date = new \DateTime($this->listingsQuery->getYear() . '-' . $this->listingsQuery->getMonth() . '-01'); } $this->listings = $this->prepareListings($this->listingsFacade->fetchListings($this->listingsQuery)->toArray(AbstractQuery::HYDRATE_SCALAR)); $template->heading = $this->heading; $template->numberOfListings = isset($this->listings) ? Arrays::count_recursive($this->listings, 1) : 0; $template->listings = $this->listings; $template->render(); }