Router
in package
Registers and verifies and requests URI and HTTP method
Table of Contents
- $methods : array<string|int, mixed>
- $uriCallback : array<string|int, mixed>
- $uriList : array<string|int, mixed>
- __call() : void
- Registers URI(s) and their callbacks
- submit() : void
- Parse route and trigger callback
- isHTTPMethodValid() : bool
- Validates if HTTP method is acceptable
Properties
$methods
private
array<string|int, mixed>
$methods
= array('GET', 'POST', 'DELETE', 'PUT')
Valid HTTP methods
$uriCallback
private
array<string|int, mixed>
$uriCallback
= ['GET' => [], 'POST' => [], 'DELETE' => [], 'PUT' => []]
Callbacks for URI(s)
$uriList
private
array<string|int, mixed>
$uriList
= ['GET' => [], 'POST' => [], 'DELETE' => [], 'PUT' => []]
Valid URI(s)
Methods
__call()
Registers URI(s) and their callbacks
public
__call(mixed $name, mixed $arguments) : void
Parameters
- $name : mixed
- $arguments : mixed
Return values
void —submit()
Parse route and trigger callback
public
submit() : void
Return values
void —isHTTPMethodValid()
Validates if HTTP method is acceptable
private
isHTTPMethodValid(string $method) : bool
Parameters
- $method : string