Raydium Framework

Router
in package
implements MiddlewareInterface

Interfaces, Classes, Traits and Enums

MiddlewareInterface

Table of Contents

$dispatcher  : Dispatcher|null
$postItem  : array<string|int, mixed>
$routes  : array<string|int, mixed>
$twig  : Environment|null
__construct()  : mixed
delete()  : void
get()  : void
post()  : void
process()  : ResponseInterface
put()  : void
setPostItem()  : void
handleFoundRoute()  : ResponseInterface
addRoute()  : void
createResponse()  : HtmlResponse
handle404()  : ResponseInterface
initDispatcher()  : void
resolve()  : mixed
resolveTemplate()  : string

Properties

$dispatcher

private Dispatcher|null $dispatcher = null

$postItem

private array<string|int, mixed> $postItem = []

$routes

private array<string|int, mixed> $routes = []

$twig

private Environment|null $twig

Methods

__construct()

public __construct([Environment|null $twig = null ]) : mixed
Parameters
$twig : Environment|null = null
Return values
mixed

delete()

public delete(string $path, mixed $handler) : void
Parameters
$path : string
$handler : mixed
Return values
void

get()

public get(string $path, false|string $handler) : void
Parameters
$path : string
$handler : false|string
Return values
void

post()

public post(string $path, mixed $handler) : void
Parameters
$path : string
$handler : mixed
Return values
void

process()

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
$request : ServerRequestInterface
$handler : RequestHandlerInterface
Return values
ResponseInterface

put()

public put(string $path, mixed $handler) : void
Parameters
$path : string
$handler : mixed
Return values
void

setPostItem()

public setPostItem([array<string|int, mixed>|null $postItem = null ]) : void
Parameters
$postItem : array<string|int, mixed>|null = null
Return values
void

handleFoundRoute()

protected handleFoundRoute(mixed $callback, array<string|int, mixed> $vars, ServerRequestInterface $request) : ResponseInterface
Parameters
$callback : mixed
$vars : array<string|int, mixed>
$request : ServerRequestInterface
Return values
ResponseInterface

addRoute()

private addRoute(string $method, string $path, mixed $handler) : void
Parameters
$method : string
$path : string
$handler : mixed
Return values
void

createResponse()

private createResponse(int $status, string $body) : HtmlResponse
Parameters
$status : int
$body : string
Return values
HtmlResponse

handle404()

private handle404(ServerRequestInterface $request) : ResponseInterface
Parameters
$request : ServerRequestInterface
Return values
ResponseInterface

initDispatcher()

private initDispatcher() : void
Return values
void

resolve()

private static resolve(mixed $callback) : mixed
Parameters
$callback : mixed
Return values
mixed

resolveTemplate()

private resolveTemplate(string $handler, array<string|int, mixed> $vars) : string
Parameters
$handler : string
$vars : array<string|int, mixed>
Return values
string

Search results