abstract class Treaty extends Router (View source)

Constants

SLASH

Create a route with slash at the end, like: /foo/

NOSLASH

Create a route without slash at the end, like: /foo

Properties

static protected array $httpRoutes

Store normal routes

from  Router
static protected array $httpParamRoutes

Store param routes

from  Router
static protected string $prefixNS

Define namespace prefix to Controllers

from  Router
static protected string $prefixPath

Define path prefix to routes

from  Router
protected int $format

Define path format, possible values: self::SLASH, self::NOSLASH, self::SLASH|self::NOSLASH

Methods

static bool
find(string $route, string $path, array $matches)

Get params from routes using regex

from  Router
mixed
route()

Define routes based on class methods

static mixed
action()

Define routes based on class methods

static string
parsePath(string $path)

Overwrite path parser

Details

static protected bool find(string $route, string $path, array $matches)

Get params from routes using regex

Parameters

string $route
string $path
array $matches

Return Value

bool

mixed route()

Define routes based on class methods

Return Value

mixed

Exceptions

Exception

static mixed action()

Define routes based on class methods

Return Value

mixed

Exceptions

Exception

static protected string parsePath(string $path)

Overwrite path parser

Parameters

string $path

Return Value

string