src/SlimController/Slim.php
protected function buildCallbackFromControllerRoute($route)
    {
        list($controller, $methodName) = $this->determineClassAndMethod($route);
        $app      = & $this;
        $callable = function () use ($app, $controller, $methodName) {
            // Get action arguments
            $args = func_get_args();
            // Try to fetch the instance from Slim's container, otherwise lazy-instantiate it
            $instance = $app->container->has($controller) ? $app->container->get($controller) : new $controller($app);

            return call_user_func_array(array($instance, $methodName), $args);
        };

        return $callable;
    }
protected function buildCallbackFromControllerRoute($route)
    {
        list($controller, $methodName) = $this->determineClassAndMethod($route);
        $app      = & $this;
        $callable = function () use ($app, $controller, $methodName) {
            // Get action arguments
            $args = func_get_args();
            // Try to fetch the instance from Slim's container, otherwise lazy-instantiate it
            $instance = $app->container->has($controller) ? $app->container->get($controller) : new $controller($app);

            return call_user_func_array(array($instance, $methodName), $args);
        };

        return $callable;
    }
protected function buildCallbackFromControllerRoute ( $ route ) { list ( $ controller , $ methodName ) = $ this -> determineClassAndMethod ( $ route ) ; $ app = & $ this ; $ callable = function ( ) use ( $ app , $ controller , $ methodName ) { // Get action arguments $ args = func_get_args ( ) ; // Try to fetch the instance from Slim's container, otherwise lazy-instantiate it $ instance = $ app -> container -> has ( $ controller ) ? $ app -> container -> get ( $ controller ) : new $ controller ( $ app ) ; return call_user_func_array ( array ( $ instance , $ methodName ) , $ args ) ; } ; return $ callable ; }
Builds closure callback from controller route

@param $route

@return \Closure
Builds closure callback from controller route