/** * Ejecuta el controlador solicitado */ protected function executeController() { switch ($this->actionOractions) { case true: $this->controller = new $this->action($this->config); $this->controller->execute(); break; case false: $this->controller = new $this->module($this->config); if (method_exists($this->controller, $this->action) === false) { throw new PDOException('La acción solicitadad no existe'); } $this->controller->{$this->action}(); break; } }
/** * Ejecuta el controlador solicitado */ protected function executeController() { switch ($this->actionOrActions) { case 1: $action = $this->action . 'Action'; $this->controller = new $action($this->config); $this->controller->execute(); break; case 2: $this->controller = new $this->action($this->config); $this->controller->execute(); break; case 3: $module = $this->module . 'Controller'; $this->controller = new $module($this->config); if (method_exists($this->controller, $this->action) === false) { throw new PDOException('La acción solicitadad no existe'); } $this->controller->{$this->action}(); break; case 4: $this->controller = new $this->module($this->config); if (method_exists($this->controller, $this->action) === false) { throw new PDOException('La acción solicitadad no existe'); } $this->controller->{$this->action}(); break; case 5: $module = $this->alternateController . 'Controller'; $this->controller = new $module($this->config); if (method_exists($this->controller, $this->action) === false) { throw new PDOException('La acción solicitadad no existe'); } $this->controller->{$this->action}(); break; case 6: $this->controller = new $this->alternateController($this->config); if (method_exists($this->controller, $this->action) === false) { throw new PDOException('La acción solicitadad no existe'); } $this->controller->{$this->action}(); } }