class Route (View source)

Methods

__construct(string $path, mixed $cb)

Route constructor

string
getPath()

Get the path of the current road

mixed
getAction()

Get the action executed on the current route

middleware(array|string $middleware)

Add middleware

where(array|string $where, string $regex_constraint = null)

Add the url rules

mixed
call()

Function to launch callback functions where the rule have matching.

name(string $name)

To give a name to the road

string
getName()

Get the name of the route

array
getParameters()

Get the settings

string|null
getParameter(string $key)

Get a parameter element

bool
match(string $uri)

Lets check if the url of the query is conform to that defined by the router

Details

__construct(string $path, mixed $cb)

Route constructor

Parameters

string $path
mixed $cb

Exceptions

string getPath()

Get the path of the current road

Return Value

string

mixed getAction()

Get the action executed on the current route

Return Value

mixed

Route middleware(array|string $middleware)

Add middleware

Parameters

array|string $middleware

Return Value

Route

Route where(array|string $where, string $regex_constraint = null)

Add the url rules

Parameters

array|string $where
string $regex_constraint

Return Value

Route

mixed call()

Function to launch callback functions where the rule have matching.

Return Value

mixed

Exceptions

Route name(string $name)

To give a name to the road

Parameters

string $name

Return Value

Route

string getName()

Get the name of the route

Return Value

string

array getParameters()

Get the settings

Return Value

array

string|null getParameter(string $key)

Get a parameter element

Parameters

string $key

Return Value

string|null

bool match(string $uri)

Lets check if the url of the query is conform to that defined by the router

Parameters

string $uri

Return Value

bool