|
| set (string $uri, int $method, callable $action, bool $default=false) |
|
| set404Route (callable $action) |
|
| setHook (string $hook, bool $after=false) |
|
|
| $uri = "" |
|
| $method = 0b0 |
|
| $action = null |
|
| $isDefault = false |
|
| $is404 = false |
|
| $beforeDispatch = "" |
|
| $afterDispatch = "" |
|
| $_getSetPrepend = "" |
|
SlaxWeb\Router\Route::set |
( |
string |
$uri, |
|
|
int |
$method, |
|
|
callable |
$action, |
|
|
bool |
$default = false |
|
) |
| |
Set Route data
Sets the retrieved data to internal properties. Prior to setting, the method is checked, that it is valid, and raises an 'InvalidMethodException' on error.
- Parameters
-
string | $uri | Request URI regex without delimiter |
int | $method | HTTP Request Method, accepts METHODO_* constant |
callable | $action | Route action |
bool | $default | Should the route be marked as default. Default bool(false) |
- Returns
- self
SlaxWeb\Router\Route::set404Route |
( |
callable |
$action | ) |
|
SlaxWeb\Router\Route::setHook |
( |
string |
$hook, |
|
|
bool |
$after = false |
|
) |
| |
Set hook
Sets a hook name for the before or after dispatch hook name to be executed before or after the Route has been dispatched. Takes the name of the hook as the first argument, and a bool value as the second. If ommited or set to false, the hook name will be used before dispatch event, and after dispatch event if set to true.
- Parameters
-
string | $hook | Name of the hook to be executed |
bool | $after | Defines if the hook is to be executed before or after dispatch, default bool(false) |
- Returns
- self
const SlaxWeb\Router\Route::METHOD_ANY = 0b11111 |
const SlaxWeb\Router\Route::METHOD_CLI = 0b10000 |
Method Command Line Interface
const SlaxWeb\Router\Route::METHOD_DELETE = 0b1000 |
const SlaxWeb\Router\Route::METHOD_GET = 0b1 |
const SlaxWeb\Router\Route::METHOD_POST = 0b10 |
const SlaxWeb\Router\Route::METHOD_PUT = 0b100 |
The documentation for this class was generated from the following file:
- /opt/slax0rDev/slaxweb/router/src/Route.php