src/Vectorface/SnappyRouter/Handler/ControllerHandler.php
protected function invokeControllerAction(AbstractController $controller, $action)
    {
        $this->invokePluginsHook(
            'beforeActionInvoked',
            array($this, $this->getRequest(), $controller, $action)
        );
        $response = $controller->$action($this->routeParams);
        if (null === $response) {
            // if the action returns null, we simply render the default view
            $response = array();
        } elseif (!is_string($response)) {
            // if they don't return a string, try to use whatever is returned
            // as variables to the view renderer
            $response = (array)$response;
        }

        // merge the response variables with the existing view context
        if (is_array($response)) {
            $response = array_merge($controller->getViewContext(), $response);
        }

        // whatever we have as a response needs to be encapsulated in an
        // AbstractResponse object
        if (!($response instanceof AbstractResponse)) {
            $response = new Response($response);
        }
        $this->invokePluginsHook(
            'afterActionInvoked',
            array($this, $this->getRequest(), $controller, $action, $response)
        );
        return $response;
    }
protected function invokeControllerAction(AbstractController $controller, $action)
    {
        $this->invokePluginsHook(
            'beforeActionInvoked',
            array($this, $this->getRequest(), $controller, $action)
        );
        $response = $controller->$action($this->routeParams);
        if (null === $response) {
            // if the action returns null, we simply render the default view
            $response = array();
        } elseif (!is_string($response)) {
            // if they don't return a string, try to use whatever is returned
            // as variables to the view renderer
            $response = (array)$response;
        }

        // merge the response variables with the existing view context
        if (is_array($response)) {
            $response = array_merge($controller->getViewContext(), $response);
        }

        // whatever we have as a response needs to be encapsulated in an
        // AbstractResponse object
        if (!($response instanceof AbstractResponse)) {
            $response = new Response($response);
        }
        $this->invokePluginsHook(
            'afterActionInvoked',
            array($this, $this->getRequest(), $controller, $action, $response)
        );
        return $response;
    }
protected function invokeControllerAction ( AbstractController $ controller , $ action ) { $ this -> invokePluginsHook ( 'beforeActionInvoked' , array ( $ this , $ this -> getRequest ( ) , $ controller , $ action ) ) ; $ response = $ controller -> $ action ( $ this -> routeParams ) ; if ( null === $ response ) { // if the action returns null, we simply render the default view $ response = array ( ) ; } elseif ( ! is_string ( $ response ) ) { // if they don't return a string, try to use whatever is returned // as variables to the view renderer $ response = ( array ) $ response ; } // merge the response variables with the existing view context if ( is_array ( $ response ) ) { $ response = array_merge ( $ controller -> getViewContext ( ) , $ response ) ; } // whatever we have as a response needs to be encapsulated in an // AbstractResponse object if ( ! ( $ response instanceof AbstractResponse ) ) { $ response = new Response ( $ response ) ; } $ this -> invokePluginsHook ( 'afterActionInvoked' , array ( $ this , $ this -> getRequest ( ) , $ controller , $ action , $ response ) ) ; return $ response ; }
Invokes the actual controller action and returns the response.
@param AbstractController $controller The controller to use.
@param string $action The action to invoke.
@return AbstractResponse Returns the response from the action.
Invokes the actual controller action and returns the response .