\LiftKit\RouterRouter

Basic Router

This is a simple Router. A Router is a container class that stores Route objects, and executes the first match when the execute() method is called.

Summary

Methods
Properties
Constants
registerRoute()
execute()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

registerRoute()

registerRoute(\LiftKit\Router\Route\Route  $route, string  $routeIdentifier = null) 

Registers a new Route

Parameters

\LiftKit\Router\Route\Route $route

Route object

string $routeIdentifier

A string identifier for the Route. Optional.

execute()

execute(\LiftKit\Request\Request  $request) : \LiftKit\Response\Response

Iterates over stored routes in the order they were registered. Executes the first matching route.

Parameters

\LiftKit\Request\Request $request

An object that represents the request.

Returns

\LiftKit\Response\Response