class Router

Generates route objects containing MVVM component class names relevant to incoming requests.

A static routing table is used to return route objects configured to instantiate the relevant view, model, viewModel and controller components for this page.

Methods

__construct(array $routingTable)

Constructor

route(string $path)

Returns a route object containing the classnames of the MVVMC components required for this route.

Details

at line 42
__construct(array $routingTable)

Constructor

Parameters

array $routingTable Array of routes and components required to initialise them.

at line 53
Route route(string $path)

Returns a route object containing the classnames of the MVVMC components required for this route.

Parameters

string $path The path component of the URL associated with this request.

Return Value

Route Route object.