Exemple #1
0
 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");
 }
Exemple #2
0
 public function index()
 {
     if (Session::loggedIn) {
         header("Location: /");
     } else {
         $this->template("header", ["title" => App::NAME, "subtitle" => App::TAGLINE, "categories" => ArticleCategory::getObjsAll()]);
         // $this->template("hero", ["title" => "News"]);
         $this->view("auth/index");
         $this->template("footer");
     }
 }
Exemple #3
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: /");
     }
 }
Exemple #4
0
 public function index()
 {
     if (Session::loggedIn()) {
         $this->template("header", ["title" => App::NAME, "subtitle" => App::TAGLINE, "categories" => ArticleCategory::getObjsAll()]);
         // $this->template("hero", ["title" => "News"]);
         $this->view("account/index", ["user" => User::getObjByEmail(Session::getUsername())]);
         //$this->jq("account/index");
         $this->template("footer");
     } else {
         header("Location: /");
     }
 }
Exemple #5
0
 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: /");
     }
 }
Exemple #6
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: /");
     }
 }
Exemple #7
0
 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: /");
     }
 }