PHP Class Phprest\Router\Strategy

Inheritance: extends League\Route\Strategy\AbstractStrategy, implements League\Route\Strategy\StrategyInterface, use trait Phprest\Service\Hateoas\Util
Datei anzeigen Open project: phprest/phprest Class Usage Examples

Protected Properties

Property Type Description
$container League\Container\ContainerInterface

Public Methods

Method Description
__construct ( League\Container\ContainerInterface $container )
dispatch ( string | array | Closure $controller, array $vars ) : mixed Dispatch the controller, the return value of this method will bubble out and be returned by \League\Route\Dispatcher::dispatch, it does not require a response, however, beware that there is no output buffering by default in the router.
getContainer ( ) : League\Container\ContainerInterface Returns the DI container.

Protected Methods

Method Description
serviceHateoas ( ) : Hateoas\Hateoas

Method Details

__construct() public method

public __construct ( League\Container\ContainerInterface $container )
$container League\Container\ContainerInterface

dispatch() public method

$controller can be one of three types but based on the type you can infer what the controller actually is: - string (controller is a named function) - array (controller is a class method [0 => ClassName, 1 => MethodName]) - \Closure (controller is an anonymous function)
public dispatch ( string | array | Closure $controller, array $vars ) : mixed
$controller string | array | Closure
$vars array - named wildcard segments of the matched route
return mixed

getContainer() public method

Returns the DI container.
public getContainer ( ) : League\Container\ContainerInterface
return League\Container\ContainerInterface

serviceHateoas() protected method

protected serviceHateoas ( ) : Hateoas\Hateoas
return Hateoas\Hateoas

Property Details

$container protected_oe property

protected ContainerInterface,League\Container $container
return League\Container\ContainerInterface