\FastRouteRouteCollector

Summary

Methods
Properties
Constants
__construct()
addRoute()
addGroup()
get()
post()
put()
delete()
patch()
head()
getData()
No public properties found
No constants found
No protected methods found
$routeParser
$dataGenerator
$currentGroupPrefix
N/A
No private methods found
No private properties found
N/A

Properties

$currentGroupPrefix

$currentGroupPrefix : string

Type

string

Methods

addRoute()

addRoute(string|array<mixed,string>  $httpMethod, string  $route, mixed  $handler) 

Adds a route to the collection.

The syntax used in the $route string depends on the used route parser.

Parameters

string|array<mixed,string> $httpMethod
string $route
mixed $handler

addGroup()

addGroup(string  $prefix, callable  $callback) 

Create a route group with a common prefix.

All routes created in the passed callback will have the given group prefix prepended.

Parameters

string $prefix
callable $callback

get()

get(string  $route, mixed  $handler) 

Adds a GET route to the collection

This is simply an alias of $this->addRoute('GET', $route, $handler)

Parameters

string $route
mixed $handler

post()

post(string  $route, mixed  $handler) 

Adds a POST route to the collection

This is simply an alias of $this->addRoute('POST', $route, $handler)

Parameters

string $route
mixed $handler

put()

put(string  $route, mixed  $handler) 

Adds a PUT route to the collection

This is simply an alias of $this->addRoute('PUT', $route, $handler)

Parameters

string $route
mixed $handler

delete()

delete(string  $route, mixed  $handler) 

Adds a DELETE route to the collection

This is simply an alias of $this->addRoute('DELETE', $route, $handler)

Parameters

string $route
mixed $handler

patch()

patch(string  $route, mixed  $handler) 

Adds a PATCH route to the collection

This is simply an alias of $this->addRoute('PATCH', $route, $handler)

Parameters

string $route
mixed $handler

head()

head(string  $route, mixed  $handler) 

Adds a HEAD route to the collection

This is simply an alias of $this->addRoute('HEAD', $route, $handler)

Parameters

string $route
mixed $handler

getData()

getData() : array

Returns the collected route data, as provided by the data generator.

Returns

array