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
Methods
- __construct() : mixed
- addSwitchFor() : PioniaRouter
- getRoutes() : BaseRoutes
- wireTo() : PioniaRouter
- Adds a switch for a certain api version
- cleanVersion() : string
Properties
$routes
protected
BaseRoutes
$routes
$apiBase
private
string
$apiBase
= '/api/'
Methods
__construct()
public
__construct([BaseRoutes|null $routes = null ]) : mixed
Parameters
- $routes : BaseRoutes|null = null
addSwitchFor()
public
addSwitchFor(string $switch[, string|null $versionName = 'v1' ]) : PioniaRouter
Parameters
- $switch : string
- $versionName : string|null = 'v1'
Tags
Return values
PioniaRoutergetRoutes()
public
getRoutes() : BaseRoutes
Return values
BaseRouteswireTo()
Adds a switch for a certain api version
public
wireTo(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
PioniaRoutercleanVersion()
private
cleanVersion(string $str) : string
Parameters
- $str : string