public function prepare() { parent::prepare(); $this->template = APP_VIEWS_ROOT . '/templates/pages/index.php'; $newsModel = new News(); $news = $newsModel->limit(5)->order('published', 'desc')->get(); $this->setTemplateVariable('news_items', $news); }
public function prepare() { parent::prepare(); $this->template = APP_VIEWS_ROOT . '/templates/pages/base_page.php'; $news = $this->news; if (is_null($news)) { throw new \Exception('To display news it should be passed from controller'); } $this->setTemplateVariable('page_title', $news['title']); $this->setTemplateVariable('content', $news['text']); }
public function prepare() { parent::prepare(); $this->template = APP_VIEWS_ROOT . '/templates/pages/text_page_' . $this->page . '.php'; $this->appendToTemplateVariable('body_classes', $this->page); }
public function prepare() { parent::prepare(); $this->template = APP_VIEWS_ROOT . '/templates/pages/login.php'; $this->setTemplateVariable('errors', $this->errors); }