コード例 #1
0
ファイル: homeController.php プロジェクト: TMTK11/website
 public function getHTML()
 {
     if ($this->url[1] == 'login' && $this->loginResult) {
         $message = "<h1>Welkom </h1>";
         $message .= "<p>U ben nu ingelogd.</p>";
         $title = "Login ";
         $details = array("contentLeft" => $message, "title" => $title);
         $layout = new LayoutController($details);
         $html = $layout->getHTML();
     } elseif ($this->url[1] == 'login' && !$this->loginResult) {
         $errorController = new errorController(array("title" => "Foute login!", "message" => "Verkeerde gebruikersnaam of wachtwoord."));
         $html = $errorController->getHTML();
     } else {
         $message = "<h1>Home</h1>";
         $message .= "<p>Welkom op de pagina voor TMTK1-11. Hier maken wij ons MVC CMS.</p>";
         $title = "Home ";
         $details = array("contentLeft" => $message, "title" => $title);
         $layout = new LayoutController($details);
         $html = $layout->getHTML();
     }
     return $html;
 }
コード例 #2
0
ファイル: controller.php プロジェクト: TMTK11/website
 public function getHTML()
 {
     switch ($this->state) {
         //Page output / error handling
         case 'DONE':
             $html = $this->pagecontroller->getHTML();
             return $html;
             break;
         case 'CONTROLLER_INACTIVE':
             $message = array("title" => "Inactief!", "message" => "Pagina is niet (meer) actief");
             $errorController = new errorController($message);
             return $errorController->getHTML();
             break;
         case 'CONTROLLER_NOT_FOUND':
             $message = array("title" => "Kritieke fout!", "message" => "Fout tijdens het laden van de pagina. Neem contact op met de eigenaar van deze pagina.");
             $errorController = new errorController($message);
             return $errorController->getHTML();
             break;
         default:
             $message = array("title" => "Fout!", "message" => "Een onbekende fout heeft zich voorgedaan. Probeer het opnieuw.");
             $errorController = new errorController($message);
             return $errorController->getHTML();
             break;
     }
 }