Пример #1
0
 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);
 }
Пример #2
0
 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']);
 }
Пример #3
0
 public function prepare()
 {
     parent::prepare();
     $this->template = APP_VIEWS_ROOT . '/templates/pages/text_page_' . $this->page . '.php';
     $this->appendToTemplateVariable('body_classes', $this->page);
 }
Пример #4
0
 public function prepare()
 {
     parent::prepare();
     $this->template = APP_VIEWS_ROOT . '/templates/pages/login.php';
     $this->setTemplateVariable('errors', $this->errors);
 }