Example #1
0
 public function action_p404()
 {
     header("HTTP/1.1 404 Not Found");
     $this->title = 'Cтраница не найдена';
     $message = 'Ошибка 404.Запрашиваемая страница не найдена';
     $this->content = View::template('page/v_404.php', ['message' => $message]);
 }
Example #2
0
 public function showException()
 {
     header("HTTP/1.1 404 Not Found");
     $this->title = 'Страница не найдена';
     $this->content = View::template('exceptions/v_404.php', ['message' => $this->message]);
     $this->view = View::template($this->template, ['title' => $this->title, 'content' => $this->content]);
     echo $this->view;
 }
Example #3
0
 public function action_tag()
 {
     $id = $this->params[2];
     $tag = $this->tag->one($id);
     $posts = $this->post->getAllByTag($id);
     //var_dump($posts);
     $this->title = 'Новости по тегу: ' . $tag['name'];
     $posts_id = [];
     foreach ($posts as $one) {
         $posts_id[] = $one['id_post'];
     }
     // 74, 75, ///, 78
     $tags = $this->tag->getTagsForAll($posts_id);
     $this->content = View::template('post/v_allbytags.php', ['posts' => $posts, 'tags' => $tags]);
 }
Example #4
0
 public function action_index()
 {
     // если уже авторизован, то сразу кидаем в админку
     if ($this->auth->user() != false) {
         header('Location: /' . ADMIN_URL);
         exit;
     }
     if (isset($_POST['login'])) {
         if ($this->auth->login($_POST['email'], $_POST['password'], isset($_POST['remember']))) {
             header('Location: /' . ADMIN_URL);
             exit;
         }
     }
     $this->content = View::template('user/v_auth.php');
 }
Example #5
0
 public function render()
 {
     $main = View::template('base_templates/' . $this->base_template, ['title' => $this->title, 'content' => $this->content, 'left' => $this->left, 'admin_link' => $this->admin_link, 'active_user' => $this->active_user]);
     echo $main;
 }