class DefaultRouter extends Router

Der DefaultRouter implementiert einen Standard, der Routen aus einer Textdatei einliest und diese verarbeitet.

Properties

protected Web $assembly from Router
protected integer $counter from Router
protected array $recursionProtection from Router
protected Map $routes
protected File $file

Methods

__construct(Web $app, File $file)

DefaultRouter erstellen

addRoute(Route $route)

Route hinzufügen

removeRoute(Route $route)

Route aus dem Routing entfernen

Map
getRoutes()

Gibt die Route zurück

Route|null
getRoute(string $id)

Gibt die Route mit der ID zurück

execute(string $route)

Routing ausführen

executeRoute(string $method, string $entry, URI $validatedRoute)

Route ausführen.

from Router
integer
getExecutedNumber()

Routing-Zähler

from Router
getAssembly()

Assembly

from Router
init()

No description

static DefaultRouter
getInstanceFromProperties(Assembly $app, Properties $properties)

Defaultroute erstelle

Details

at line 59
__construct(Web $app, File $file)

DefaultRouter erstellen

Erstellt aus einer Textdatei einen DefaultRouter mit den entsprechenden Routingeinträgen.

Parameters

Web $app
File $file Routing-Datei

at line 164
Collection addRoute(Route $route)

Route hinzufügen

Parameters

Route $route

Return Value

Collection

at line 179
Router removeRoute(Route $route)

Route aus dem Routing entfernen

Parameters

Route $route Route

Return Value

Router Dieses Objekt

at line 190
Map getRoutes()

Gibt die Route zurück

Return Value

Map Route

at line 201
Route|null getRoute(string $id)

Gibt die Route mit der ID zurück

Parameters

string $id ID der Route

Return Value

Route|null Route

at line 109
Router execute(string $route)

Routing ausführen

Parameters

string $route Route

Return Value

Router Dieses Objekt

Exceptions

RouteNotFoundException
RouteException
AccessDenied

in Router at line 134
protected Router executeRoute(string $method, string $entry, URI $validatedRoute)

Route ausführen.

Parameters

string $method
string $entry
URI $validatedRoute

Return Value

Router

Exceptions

RouteException
Exception

in Router at line 165
integer getExecutedNumber()

Routing-Zähler

Anzahl der durchgeführten Routings.

Return Value

integer Anzahl

in Router at line 174
Assembly getAssembly()

Assembly

Return Value

Assembly

at line 72
protected DefaultRouter init()

Return Value

DefaultRouter

at line 92
static DefaultRouter getInstanceFromProperties(Assembly $app, Properties $properties)

Defaultroute erstelle

DefaultRouter über Eigenschaften erstellen

In der Eigenschaft filename muss der Pfad auf die Routendatei gesetzt sein.

Parameters

Assembly $app
Properties $properties Eigenschaften

Return Value

DefaultRouter

Exceptions

MissingPropertyException