public function run()
    {
        // The MVP process is here ...
        /* @var Psr\Http\Message\ResponseInterface $response */
        $response  = $this->getResponse();
        $presenter = $this->getPresenter();
        $action    = $this->getAction();
        $view      = $this->getView();

        // Use inofficial standard "xAction()"
        $method = $action.'Action';

        // Validate that request mapped to a route (foo:bar) can be executed by Doozr
        if (true === $httpStatus = $this->validateRequest($presenter, $method)) {

            // If we have a view attach it
            if (null !== $view && $view instanceof Doozr_Base_View) {
                $presenter->attach($view);
            }

            // Call the requested Action on requested Presenter (Presenter:Action)
            $data = $presenter->{$method}();

            // Create a response body with write access
            $responseBody = new Doozr_Response_Body('php://memory', 'w');
            $responseBody->write($data[Doozr_Base_Presenter::IDENTIFIER_VIEW]);

            $response = $response->withBody($responseBody);
            $response = $response->withStatus(Doozr_Http::OK);
        } else {
            // So if the Status is not TRUE (successful) it contains an integer for HTTP Response :)
            switch ($httpStatus) {
                case Doozr_Http::BAD_REQUEST:
                    $message = sprintf(
                        'No Presenter to execute route ("%s"). Sure it exists?',
                        $this->getRoute()
                    );
                    break;

                case Doozr_Http::NOT_FOUND:
                default:
                    $message = sprintf(
                        'Method "%s()" of class "%s" not callable. Sure it exists and it\'s public?',
                        $method,
                        'Presenter_'.ucfirst($this->getClassName())
                    );
                    break;
            }

            throw new Doozr_Route_Exception(
                $message,
                $httpStatus
            );
        }

        // Return all data returned and fetched in data
        return $response;
    }
public function run()
    {
        // The MVP process is here ...
        /* @var Psr\Http\Message\ResponseInterface $response */
        $response  = $this->getResponse();
        $presenter = $this->getPresenter();
        $action    = $this->getAction();
        $view      = $this->getView();

        // Use inofficial standard "xAction()"
        $method = $action.'Action';

        // Validate that request mapped to a route (foo:bar) can be executed by Doozr
        if (true === $httpStatus = $this->validateRequest($presenter, $method)) {

            // If we have a view attach it
            if (null !== $view && $view instanceof Doozr_Base_View) {
                $presenter->attach($view);
            }

            // Call the requested Action on requested Presenter (Presenter:Action)
            $data = $presenter->{$method}();

            // Create a response body with write access
            $responseBody = new Doozr_Response_Body('php://memory', 'w');
            $responseBody->write($data[Doozr_Base_Presenter::IDENTIFIER_VIEW]);

            $response = $response->withBody($responseBody);
            $response = $response->withStatus(Doozr_Http::OK);
        } else {
            // So if the Status is not TRUE (successful) it contains an integer for HTTP Response :)
            switch ($httpStatus) {
                case Doozr_Http::BAD_REQUEST:
                    $message = sprintf(
                        'No Presenter to execute route ("%s"). Sure it exists?',
                        $this->getRoute()
                    );
                    break;

                case Doozr_Http::NOT_FOUND:
                default:
                    $message = sprintf(
                        'Method "%s()" of class "%s" not callable. Sure it exists and it\'s public?',
                        $method,
                        'Presenter_'.ucfirst($this->getClassName())
                    );
                    break;
            }

            throw new Doozr_Route_Exception(
                $message,
                $httpStatus
            );
        }

        // Return all data returned and fetched in data
        return $response;
    }
public function run ( ) { // The MVP process is here ... /* @var Psr\Http\Message\ResponseInterface $response */ $ response = $ this -> getResponse ( ) ; $ presenter = $ this -> getPresenter ( ) ; $ action = $ this -> getAction ( ) ; $ view = $ this -> getView ( ) ; // Use inofficial standard "xAction()" $ method = $ action . 'Action' ; // Validate that request mapped to a route (foo:bar) can be executed by Doozr if ( true === $ httpStatus = $ this -> validateRequest ( $ presenter , $ method ) ) { // If we have a view attach it if ( null !== $ view && $ view instanceof Doozr_Base_View ) { $ presenter -> attach ( $ view ) ; } // Call the requested Action on requested Presenter (Presenter:Action) $ data = $ presenter -> { $ method } ( ) ; // Create a response body with write access $ responseBody = new Doozr_Response_Body ( 'php://memory' , 'w' ) ; $ responseBody -> write ( $ data [ Doozr_Base_Presenter :: IDENTIFIER_VIEW ] ) ; $ response = $ response -> withBody ( $ responseBody ) ; $ response = $ response -> withStatus ( Doozr_Http :: OK ) ; } else { // So if the Status is not TRUE (successful) it contains an integer for HTTP Response :) switch ( $ httpStatus ) { case Doozr_Http :: BAD_REQUEST : $ message = sprintf ( 'No Presenter to execute route ("%s"). Sure it exists?' , $ this -> getRoute ( ) ) ; break ; case Doozr_Http :: NOT_FOUND : default : $ message = sprintf ( 'Method "%s()" of class "%s" not callable. Sure it exists and it\'s public?' , $ method , 'Presenter_' . ucfirst ( $ this -> getClassName ( ) ) ) ; break ; } throw new Doozr_Route_Exception ( $ message , $ httpStatus ) ; } // Return all data returned and fetched in data return $ response ; }
Dispatches the request to the backend layers. This can be "Model" "View" "Presenter".

@author Benjamin Carl <opensource@clickalicious.de>

@return Response

@throws \Doozr_Route_Exception
Dispatches the request to the backend layers . This can be Model View Presenter .