class router implements RouterInterface

Integration of all pieces of the routing system for easier use.

Properties

protected ContainerInterface $container
protected resources_locator_interface $resources_locator
protected LoaderInterface $loader
protected string $php_ext

PHP file extensions

protected UrlMatcherInterface|null $matcher
protected UrlGeneratorInterface|null $generator
protected RequestContext $context
protected RouteCollection $route_collection
protected string $cache_dir

Methods

__construct(ContainerInterface $container, resources_locator_interface $resources_locator, LoaderInterface $loader, string $php_ext, string $cache_dir)

Construct method

RouteCollection
get_routes()

Get the list of routes

getRouteCollection()

{@inheritdoc}

setContext(RequestContext $context)

{@inheritdoc}

getContext()

{@inheritdoc}

generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)

{@inheritdoc}

match($pathinfo)

{@inheritdoc}

UrlMatcherInterface
get_matcher()

Gets the UrlMatcher instance associated with this Router.

create_dumped_url_matcher()

Creates a new dumped URL Matcher (dump it if necessary)

create_new_url_matcher()

Creates a new URL Matcher

UrlGeneratorInterface
get_generator()

Gets the UrlGenerator instance associated with this Router.

create_dumped_url_generator()

Creates a new dumped URL Generator (dump it if necessary)

create_new_url_generator()

Creates a new URL Generator

resolveParameters(RouteCollection $collection)

Replaces placeholders with service container parameter values in:

  • the route defaults,
  • the route requirements,
  • the route path,
  • the route host,
  • the route schemes,
  • the route methods.

Details

at line 92
__construct(ContainerInterface $container, resources_locator_interface $resources_locator, LoaderInterface $loader, string $php_ext, string $cache_dir)

Construct method

Parameters

ContainerInterface $container

DI container

resources_locator_interface $resources_locator

Resources locator

LoaderInterface $loader

Resources loader

string $php_ext

PHP file extension

string $cache_dir

phpBB cache directory

at line 107
RouteCollection get_routes()

Get the list of routes

Return Value

RouteCollection

Get the route collection

at line 133
getRouteCollection()

{@inheritdoc}

at line 141
setContext(RequestContext $context)

{@inheritdoc}

Parameters

RequestContext $context

at line 158
getContext()

{@inheritdoc}

at line 166
generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)

{@inheritdoc}

Parameters

$name
$parameters
$referenceType

at line 174
match($pathinfo)

{@inheritdoc}

Parameters

$pathinfo

at line 184
UrlMatcherInterface get_matcher()

Gets the UrlMatcher instance associated with this Router.

Return Value

UrlMatcherInterface

A UrlMatcherInterface instance

at line 199
protected create_dumped_url_matcher()

Creates a new dumped URL Matcher (dump it if necessary)

at line 229
protected create_new_url_matcher()

Creates a new URL Matcher

at line 239
UrlGeneratorInterface get_generator()

Gets the UrlGenerator instance associated with this Router.

Return Value

UrlGeneratorInterface

A UrlGeneratorInterface instance

at line 254
protected create_dumped_url_generator()

Creates a new dumped URL Generator (dump it if necessary)

at line 284
protected create_new_url_generator()

Creates a new URL Generator

at line 300
protected resolveParameters(RouteCollection $collection)

Replaces placeholders with service container parameter values in:

  • the route defaults,
  • the route requirements,
  • the route path,
  • the route host,
  • the route schemes,
  • the route methods.

Parameters

RouteCollection $collection