public function index() { $this->template("header", ["title" => App::NAME, "subtitle" => App::TAGLINE, "categories" => ArticleCategory::getObjsAll()]); // $this->template("hero", ["title" => "News"]); $this->view("front/index", ["articles" => Article::getObjsAll()]); $this->template("footer"); }
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: /"); } }
public function index($id) { if (isset($id)) { $author = Article::getObjsByAuthor($id); $this->template("header", ["title" => $author[0]->getAuthorObj()->getName(), "subtitle" => App::NAME . " " . App::TAGLINE, "categories" => ArticleCategory::getObjsAll()]); // $this->template("hero", ["title" => "News"]); $this->view("front/author", ["articles" => $author]); $this->template("footer"); } else { header("Location: /"); } }
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: /"); } }
public function index($value = null) { if (isset($value)) { $articles = Articles::getObjsBySearch($value); $this->template("header", ["title" => "Search", "subtitle" => App::NAME . " " . App::TAGLINE, "categories" => ArticleCategory::getObjsAll(), "query" => $value]); // $this->template("hero", ["title" => "News"]); $this->view("search/index", ["articles" => $articles, "query" => $value]); $this->template("footer"); } else { header("Location: /"); } }