class Quick extends Router (View source)

Constants

BOTH

Create two routes, one with slash at the end and other without, like: /foo/ and /foo, is not valid to Index method

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

Methods

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

Get params from routes using regex

from Router
static Quick
create(string $name)

Create routes based in a \Controller

void
__construct(string $name)

Create routes based in a \Controller

canonical(int $slash = Quick::NOSLASH)

Define route format, Quick::BOTH for create routes like /foo/ and /foo, Quick::SLASH for create routes like /foo/ and Quick::NOSLASH for create routes like /foo

path($path)

Define prefix path for all routes in class

void
prepare()

Create routes by configurations

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

static Quick create(string $name)

Create routes based in a \Controller

Parameters

string $name Define Controller class name

Return Value

Quick

Exceptions

Exception

void __construct(string $name)

Create routes based in a \Controller

Parameters

string $name Define controllers class name

Return Value

void

Exceptions

Exception

Quick canonical(int $slash = Quick::NOSLASH)

Define route format, Quick::BOTH for create routes like /foo/ and /foo, Quick::SLASH for create routes like /foo/ and Quick::NOSLASH for create routes like /foo

Parameters

int $slash Define path format, choose Quick::BOTH, Quick::SLASH or Quick::NOSLASH

Return Value

Quick

Quick path($path)

Define prefix path for all routes in class

Parameters

$path

Return Value

Quick

void prepare()

Create routes by configurations

Return Value

void

Exceptions

Exception