class Route (View source)

Methods

__construct(string $path, mixed $callback)

Route constructor

mixed
getAction()

Get the action executed on the current route

middleware(array|string $middleware)

Add middleware

withDomain(string $domain_pattern)

Set the domain pattern for the route

string|null
getDomain()

Get the domain pattern for the route

where(array|string $where, string|null $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
getPath()

Get the path of the current road

string|null
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, string|null $host = null)

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

Details

__construct(string $path, mixed $callback)

Route constructor

Parameters

string $path
mixed $callback

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 withDomain(string $domain_pattern)

Set the domain pattern for the route

Parameters

string $domain_pattern

Return Value

Route

string|null getDomain()

Get the domain pattern for the route

Return Value

string|null

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

Add the url rules

Parameters

array|string $where
string|null $regex_constraint

Return Value

Route

mixed call()

Function to launch callback functions where the rule have matching.

Return Value

mixed

Route name(string $name)

To give a name to the road

Parameters

string $name

Return Value

Route

string getPath()

Get the path of the current road

Return Value

string

string|null getName()

Get the name of the route

Return Value

string|null

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, string|null $host = null)

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

Parameters

string $uri
string|null $host

Return Value

bool