lithium\action\Dispatcher::_callable PHP Метод

_callable() защищенный статический Метод

Accepts parameters generated by the Router class in Dispatcher::run(), and produces a callable controller object. By default, this method uses the 'controller' path lookup configuration in Libraries::locate() to return a callable object.
protected static _callable ( object $request, array $params, array $options ) : object
$request object The instance of the `Request` class either passed into or generated by `Dispatcher::run()`.
$params array The parameter array generated by routing the request.
$options array Not currently implemented.
Результат object Returns a callable object which the request will be routed to.
    protected static function _callable($request, $params, $options)
    {
        $params = compact('request', 'params', 'options');
        return static::_filter(__FUNCTION__, $params, function ($self, $params) {
            $options = array('request' => $params['request']) + $params['options'];
            $controller = $params['params']['controller'];
            try {
                return Libraries::instance('controllers', $controller, $options);
            } catch (ClassNotFoundException $e) {
                throw new DispatchException("Controller `{$controller}` not found.", null, $e);
            }
        });
    }