public function doAction() { if (class_exists($this->_controller)) { $controller = new $this->_controller(Component\AppRegistry::getRequest()); $action = method_exists($controller, $this->_action) ? $this->_action : 'indexAction'; $controller->{$action}($this->_params); } else { header('Location: /404'); } }