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
protected string $debug_url_generator
protected string $debug_url_matcher

Methods

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

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 106
__construct(ContainerInterface $container, resources_locator_interface $resources_locator, LoaderInterface $loader, string $php_ext, string $cache_dir, string $debug_url_generator, string $debug_url_matcher)

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

string $debug_url_generator

Debug url generator

string $debug_url_matcher

Debug url matcher

at line 123
RouteCollection get_routes()

Get the list of routes

Return Value

RouteCollection

Get the route collection

at line 149
getRouteCollection()

{@inheritdoc}

at line 157
setContext(RequestContext $context)

{@inheritdoc}

Parameters

RequestContext $context

at line 174
getContext()

{@inheritdoc}

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

{@inheritdoc}

Parameters

$name
$parameters
$referenceType

at line 190
match($pathinfo)

{@inheritdoc}

Parameters

$pathinfo

at line 200
UrlMatcherInterface get_matcher()

Gets the UrlMatcher instance associated with this Router.

Return Value

UrlMatcherInterface

A UrlMatcherInterface instance

at line 215
protected create_dumped_url_matcher()

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

at line 238
protected create_new_url_matcher()

Creates a new URL Matcher

at line 248
UrlGeneratorInterface get_generator()

Gets the UrlGenerator instance associated with this Router.

Return Value

UrlGeneratorInterface

A UrlGeneratorInterface instance

at line 263
protected create_dumped_url_generator()

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

at line 286
protected create_new_url_generator()

Creates a new URL Generator

at line 302
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