request = $request; } public function executeAction($action) { if (method_exists($this, $action)) { $this->action = $action; $this->{$this->action}(); } else { $classController = get_class($this); throw new Exception("Action '$action' non définie dans la classe $classController"); } } public abstract function index(); protected function generateView($dataView = array(), $action = null) { $actionView = $this->action; if ($action != null) $actionView = $action; $classController = get_class($this); $controller = str_replace("Controller", "", $classController); $vue = new View($actionView, $controller); $vue->generate($dataView); } protected function redirect($controller, $action = null) { $root = Configuration::get("root", "/"); header("Location:" . $root . $controller . "/" . $action); } }