Pionia Core

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
example
// deprecated version
$router = new PioniaRouter();
$router->addGroup('app\controller\MyController')
   ->post('myAction', 'myAction')
  ->get('myAction', 'myAction');

// new version
$router = new PioniaRouter();
$router->addSwitchFor('app\switches\MySwitch', 'v1');
author

Jet - ezrajet9@gmail.com

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

Methods

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
throws
ControllerException
example
$router = new PioniaRouter();
$router->addSwitchFor('app\switches\MySwitch', 'v1');
Return values
PioniaRouter

cleanVersion()

private cleanVersion(string $str) : string
Parameters
$str : string
Return values
string

        
On this page

Search results