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

Methods

__construct()  : mixed
addSwitchFor()  : PioniaRouter
getRoutes()  : BaseRoutes
wireTo()  : PioniaRouter
Adds a switch for a certain api version
cleanVersion()  : string

Properties

Methods

addSwitchFor()

public addSwitchFor(string $switch[, string|null $versionName = 'v1' ]) : PioniaRouter
Parameters
$switch : string
$versionName : string|null = 'v1'
Tags
throws
Exception
Return values
PioniaRouter

wireTo()

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
throws
Exception
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