public static function redirectToRedirectURL() { if (Cookie::isItemSet("redirectURL")) { Redirect::to(Cookie::flushItem("redirectURL")); } else { Redirect::to(BASE_URL); } }
private function injectMVC($controller, $method, $vars) { $controller = "Controllers\\" . ucfirst($controller) . "Controller"; $object = new $controller(); if (method_exists($controller, $method)) { $view = call_user_func_array(array($object, $method), $vars); if (is_object($view) && get_class($view) === "hooks\\MVC\\View") { $view->render(); } else { print_r($view); } } else { if (method_exists($controller, $this->hyphenToCammelCase($method))) { $method = $this->hyphenToCammelCase($method); $view = call_user_func_array(array($object, $method), $vars); if (is_object($view) && get_class($view) === "hooks\\MVC\\View") { $view->render(); } else { print_r($view); } } else { Redirect::trigger(500); } } }