src/Vectorface/SnappyRouter/Handler/ControllerHandler.php
private function determineControllerAndAction(&$controller, &$actionName)
    {
        $request = $this->getRequest();
        $this->invokePluginsHook(
            'beforeControllerSelected',
            array($this, $request)
        );

        $controllerDiKey = $request->getController();
        try {
            $controller = $this->getServiceProvider()->getServiceInstance($controllerDiKey);
        } catch (Exception $e) {
            throw new ResourceNotFoundException(sprintf(
                'No such controller found "%s".',
                $this->getRequest()->getController()
            ));
        }
        $actionName = $request->getAction();
        if (!method_exists($controller, $actionName)) {
            throw new ResourceNotFoundException(sprintf(
                '%s does not have method %s',
                $controllerDiKey,
                $actionName
            ));
        }
        $this->invokePluginsHook(
            'afterControllerSelected',
            array($this, $request, $controller, $actionName)
        );
        $controller->initialize($request, $this);
    }
private function determineControllerAndAction(&$controller, &$actionName)
    {
        $request = $this->getRequest();
        $this->invokePluginsHook(
            'beforeControllerSelected',
            array($this, $request)
        );

        $controllerDiKey = $request->getController();
        try {
            $controller = $this->getServiceProvider()->getServiceInstance($controllerDiKey);
        } catch (Exception $e) {
            throw new ResourceNotFoundException(sprintf(
                'No such controller found "%s".',
                $this->getRequest()->getController()
            ));
        }
        $actionName = $request->getAction();
        if (!method_exists($controller, $actionName)) {
            throw new ResourceNotFoundException(sprintf(
                '%s does not have method %s',
                $controllerDiKey,
                $actionName
            ));
        }
        $this->invokePluginsHook(
            'afterControllerSelected',
            array($this, $request, $controller, $actionName)
        );
        $controller->initialize($request, $this);
    }
private function determineControllerAndAction ( & $ controller , & $ actionName ) { $ request = $ this -> getRequest ( ) ; $ this -> invokePluginsHook ( 'beforeControllerSelected' , array ( $ this , $ request ) ) ; $ controllerDiKey = $ request -> getController ( ) ; try { $ controller = $ this -> getServiceProvider ( ) -> getServiceInstance ( $ controllerDiKey ) ; } catch ( Exception $ e ) { throw new ResourceNotFoundException ( sprintf ( 'No such controller found "%s".' , $ this -> getRequest ( ) -> getController ( ) ) ) ; } $ actionName = $ request -> getAction ( ) ; if ( ! method_exists ( $ controller , $ actionName ) ) { throw new ResourceNotFoundException ( sprintf ( '%s does not have method %s' , $ controllerDiKey , $ actionName ) ) ; } $ this -> invokePluginsHook ( 'afterControllerSelected' , array ( $ this , $ request , $ controller , $ actionName ) ) ; $ controller -> initialize ( $ request , $ this ) ; }
Determines the exact controller instance and action name to be invoked
by the request.
@param mixed $controller The controller passed by reference.
@param mixed $actionName The action name passed by reference.
Determines the exact controller instance and action name to be invoked by the request .