function __construct() { //Initiate action var if ($_SERVER['REQUEST_URI'] == '/') { $this->_action = 'indexAction'; } else { $this->_action = 'status404Action'; } //if this isset action Class if (class_exists($this->_action)) { $act = new $this->_action(); //Create model class $act->render(); //Give content } else { $act = new NotfoundController(); //If this class not found, set first page $act->render(); //Give content } }
case "app": include_once "controllers/AppController.php"; $app = new appController(); //$app->render(); break; case "contents": include_once "controllers/ContentController.php"; $contents = new contentController(); //$app->render(); break; case "publish": include_once "controllers/ContentController.php"; $contents = new contentController(); $contents->publish(); break; case "library": include_once "controllers/ContentController.php"; $contents = new contentController(); $contents->library(); break; case "404": include_once "controllers/404.php"; $notfound = new NotfoundController(); $notfound->render404(); break; case "500": include_once "controllers/404.php"; $notfound = new NotfoundController(); $notfound->render500(); break; }