public function Start() { $explodedUri = preg_split('@/@', CommonController::GetCurrentUri(), NULL, PREG_SPLIT_NO_EMPTY); $uriCounter = count($explodedUri); if ($uriCounter < 1) { CommonController::Redirect("Home"); } else { $ExplicitCtrlName = 'src\\controllers\\' . $explodedUri[0] . 'Controller'; if (class_exists($ExplicitCtrlName)) { $Controller = new $ExplicitCtrlName(); if ($uriCounter > 1) { $action = $explodedUri[1]; if (method_exists($Controller, $action)) { call_user_func(array($Controller, $action)); } else { CommonController::Redirect("Home", "Show404"); } } else { CommonController::Redirect("Home", "Index"); } } else { CommonController::Redirect("Home", "Show404"); } } CommonController::Display(); }
public function ViewColl() { if (CommonController::IsAuthentified()) { CommonController::SetView("collection", "viewCollection"); } else { CommonController::Redirect("Home"); } }
public function Logout() { session_destroy(); CommonController::Redirect("Home"); }