Component/HttpKernel/Kernel.php
public function resolveController(Request $request)
    {
        // First let's get routing and ask routing to resolve route
        $route = $this
            ->getRouting($request)
                ->resolveRoute();

        // Get Controller class name
        $controllerClass    = $route->getController();

        // Get Callable name
        $callable           = $route->getCalls();

        // Check class and method are not empty
        if (!empty($controllerClass)) {
            // Check class exist
            if (!class_exists($controllerClass)) {
                throw new \Exception("Class ".$controllerClass." not found.");
            }

            // Check method exists
            if (!method_exists($controllerClass, $callable)) {
                throw new \Exception("Method ".$callable." not found in class " . $controllerClass);
            }

            return array(
                'controller'    => new $controllerClass($this->getConfig(), $request),
                'callable'      => $callable
            );
        }
    }
public function resolveController(Request $request)
    {
        // First let's get routing and ask routing to resolve route
        $route = $this
            ->getRouting($request)
                ->resolveRoute();

        // Get Controller class name
        $controllerClass    = $route->getController();

        // Get Callable name
        $callable           = $route->getCalls();

        // Check class and method are not empty
        if (!empty($controllerClass)) {
            // Check class exist
            if (!class_exists($controllerClass)) {
                throw new \Exception("Class ".$controllerClass." not found.");
            }

            // Check method exists
            if (!method_exists($controllerClass, $callable)) {
                throw new \Exception("Method ".$callable." not found in class " . $controllerClass);
            }

            return array(
                'controller'    => new $controllerClass($this->getConfig(), $request),
                'callable'      => $callable
            );
        }
    }
public function resolveController ( Request $ request ) { // First let's get routing and ask routing to resolve route $ route = $ this -> getRouting ( $ request ) -> resolveRoute ( ) ; // Get Controller class name $ controllerClass = $ route -> getController ( ) ; // Get Callable name $ callable = $ route -> getCalls ( ) ; // Check class and method are not empty if ( ! empty ( $ controllerClass ) ) { // Check class exist if ( ! class_exists ( $ controllerClass ) ) { throw new \ Exception ( "Class " . $ controllerClass . " not found." ) ; } // Check method exists if ( ! method_exists ( $ controllerClass , $ callable ) ) { throw new \ Exception ( "Method " . $ callable . " not found in class " . $ controllerClass ) ; } return array ( 'controller' => new $ controllerClass ( $ this -> getConfig ( ) , $ request ) , 'callable' => $ callable ) ; } }
Resolves controller for a given request.

@param   Request     $request
@return  array       array(ControllerInterface, callable)
Resolves controller for a given request .