class Rest extends Router (View source)

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 void
create(string $controller)

Create REST routes based in a \Controller

__construct(string $controller)

Create REST routes based in a \Controller

type(string $contentType)

Define the Content-Type header

charset(string $charset)

Define the Content-Type charset

path($path)

Define prefix path for all routes in class

void
prepare()

Define routes

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 void create(string $controller)

Create REST routes based in a \Controller

Parameters

string $controller

Return Value

void

Rest __construct(string $controller)

Create REST routes based in a \Controller

Parameters

string $controller

Return Value

Rest

Exceptions

Exception

Rest type(string $contentType)

Define the Content-Type header

Parameters

string $contentType

Return Value

Rest

Rest charset(string $charset)

Define the Content-Type charset

Parameters

string $charset

Return Value

Rest

Rest path($path)

Define prefix path for all routes in class

Parameters

$path

Return Value

Rest

void prepare()

Define routes

Return Value

void

Exceptions

Exception