class Router implements RouterInterface (View source)

Properties

protected UrlGeneratorInterface|null $generator
protected RequestContext|null $context
protected RouteCollection $collection
protected $request
protected $themePaths
$routes

Methods

__construct()

No description

RequestContext
getContext()

No description

setContext(RequestContext $context)

No description

UrlGeneratorInterface
getGenerator()

No description

setGenerator(UrlGeneratorInterface $generator)

No description

getList()

No description

setRequest(Request $req)

No description

Route
register(string $path, Closure|string $callback, string|null $handle = null, array $requirements = array(), array $options = array(), string $host = '', array|string $schemes = array(), array|string $methods = array(), string $condition = null)

Register a symfony route with as little as a path and a callback.

registerMultiple(array $routes)

No description

execute(Route $route, $parameters)

No description

setThemeByRoute($path, $theme = null, $wrapper = FILENAME_THEMES_VIEW)

Used by the theme_paths and site_theme_paths files in config/ to hard coded certain paths to various themes.

setThemesbyRoutes(array $routes)

No description

string|bool
getThemeByRoute(string $path)

This grabs the theme for a particular path, if one exists in the themePaths array.

route($data)

No description

Details

__construct()

RequestContext getContext()

Return Value

RequestContext

setContext(RequestContext $context)

Parameters

RequestContext $context

UrlGeneratorInterface getGenerator()

Return Value

UrlGeneratorInterface

setGenerator(UrlGeneratorInterface $generator)

Parameters

UrlGeneratorInterface $generator

getList()

setRequest(Request $req)

Parameters

Request $req

Route register(string $path, Closure|string $callback, string|null $handle = null, array $requirements = array(), array $options = array(), string $host = '', array|string $schemes = array(), array|string $methods = array(), string $condition = null)

Register a symfony route with as little as a path and a callback.

Parameters

string $path The full path for the route
Closure|string $callback \Closure or "dispatcher" or "\Namespace\Controller::action_method"
string|null $handle The route handle, if one is not provided the handle is generated from the path "/" => "_"
array $requirements The Parameter requirements, see Symfony Route constructor
array $options The route options, see Symfony Route constructor
string $host The host pattern this route requires, see Symfony Route constructor
array|string $schemes The schemes or scheme this route requires, see Symfony Route constructor
array|string $methods The HTTP methods this route requires, see see Symfony Route constructor
string $condition see Symfony Route constructor

Return Value

Route

registerMultiple(array $routes)

Parameters

array $routes

execute(Route $route, $parameters)

Parameters

Route $route
$parameters

setThemeByRoute($path, $theme = null, $wrapper = FILENAME_THEMES_VIEW)

Used by the theme_paths and site_theme_paths files in config/ to hard coded certain paths to various themes.

Parameters

$path
$theme
$wrapper

setThemesbyRoutes(array $routes)

Parameters

array $routes

string|bool getThemeByRoute(string $path)

This grabs the theme for a particular path, if one exists in the themePaths array.

Parameters

string $path

Return Value

string|bool

route($data)

Parameters

$data