final class SymfonyRouter (View source)

Matches the request against routes.yaml and enabled module routes, then runs the matched controller.

Methods

__construct(BootContext $context)

No description

array
match()

Match the current request to a route and return controller information.

void
process()

Process the matched route by instantiating and running the controller.

string
generateUrl(string $routeName, array $parameters = [])

Generate URL for a named route.

array
getRouteParameters()

Get route parameters from the matched route.

string|null
getMatchedRoute()

Get the matched route name.

bool
isRouteFound()

Check if route was found.

Request
getRequest()

Get the current request object.

Details

__construct(BootContext $context)

No description

Parameters

BootContext $context

What the kernel booted: module routes come from its registry, and every controller built here works from it

ModuleRegistry getModuleRegistry()

No description

Return Value

ModuleRegistry

array match()

Match the current request to a route and return controller information.

Return Value

array

Contains controller class, method, and parameters

Exceptions

Exception

void process()

Process the matched route by instantiating and running the controller.

Return Value

void

string generateUrl(string $routeName, array $parameters = [])

Generate URL for a named route.

Parameters

string $routeName
array $parameters

Return Value

string

array getRouteParameters()

Get route parameters from the matched route.

Return Value

array

string|null getMatchedRoute()

Get the matched route name.

Return Value

string|null

bool isRouteFound()

Check if route was found.

Return Value

bool

Request getRequest()

Get the current request object.

Return Value

Request