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'); } }
public function __construct(Request $req) { parent::__construct($req); $this->_model = new PostModel(AppRegistry::getConfig()); }