PioniaRouter
in package
This is the basis for defining routes in the application.
You can only add post and get routes as that what the framework tends to support.
If you need more methods, you can add them to the SupportedHttpMethods class and implement them here. However, this is meant for core framework developers only.
Tags
Table of Contents
Properties
- $routes : BaseRoutes
- $apiBase : string
- $controller : string|null
Methods
- __construct() : mixed
- addSwitchFor() : PioniaRouter
- Adds a switch for a certain api version
- getRoutes() : BaseRoutes
- cleanVersion() : string
Properties
$routes
protected
BaseRoutes
$routes
$apiBase
private
string
$apiBase
= '/api/'
$controller
private
string|null
$controller
= null
Methods
__construct()
public
__construct([BaseRoutes|null $routes = null ]) : mixed
Parameters
- $routes : BaseRoutes|null = null
addSwitchFor()
Adds a switch for a certain api version
public
addSwitchFor(string $switch[, string|null $versionName = 'v1' ]) : PioniaRouter
Parameters
- $switch : string
-
The switch to add
- $versionName : string|null = 'v1'
-
The version name to add the switch to
Tags
Return values
PioniaRoutergetRoutes()
public
getRoutes() : BaseRoutes
Return values
BaseRoutescleanVersion()
private
cleanVersion(string $str) : string
Parameters
- $str : string