示例#1
0
 public function index($id)
 {
     if (isset($id)) {
         $this->template("header", ["title" => ArticleCategory::getObj($id)->getName(), "subtitle" => App::NAME . " " . App::TAGLINE, "categories" => ArticleCategory::getObjsAll(), "currCategory" => $id]);
         // $this->template("hero", ["title" => "News"]);
         $this->view("front/index", ["articles" => Article::getObjsByCategory($id)]);
         $this->template("footer");
     } else {
         header("Location: /");
     }
 }
示例#2
0
 public function index($id)
 {
     if (isset($id)) {
         $article = Articles::getObjById($id);
         $this->template("header", ["title" => $article->getTitle(), "subtitle" => App::NAME . " / " . ArticleCategory::getObj($article->getCategory())->getName(), "categories" => ArticleCategory::getObjsAll()]);
         // $this->template("hero", ["title" => "News"]);
         $this->view("article/index", ["article" => $article]);
         $this->template("footer");
     } else {
         header("Location: /");
     }
 }