public function run($action, Request $request, Response $response)
    {
        $this->init();
        if (!$this->initCalled) {
            throw new IllegalStateException("Controller::init() must be called");
        }
        $this->response = $response;
        $this->headers  = $response->getHeaders();

        return $this->{$action . 'Action'}($request, $response);
    }
public function run($action, Request $request, Response $response)
    {
        $this->init();
        if (!$this->initCalled) {
            throw new IllegalStateException("Controller::init() must be called");
        }
        $this->response = $response;
        $this->headers  = $response->getHeaders();

        return $this->{$action . 'Action'}($request, $response);
    }
public function run ( $ action , Request $ request , Response $ response ) { $ this -> init ( ) ; if ( ! $ this -> initCalled ) { throw new IllegalStateException ( "Controller::init() must be called" ) ; } $ this -> response = $ response ; $ this -> headers = $ response -> getHeaders ( ) ; return $ this -> { $ action . 'Action' } ( $ request , $ response ) ; }
Runs the controller.

@param string   $action
@param Request  $request
@param Response $response

@return mixed The return value of the action.
Runs the controller .