Quark
in package
Middlewares microframework
Table of Contents
- $bag : mixed
- $instance : mixed
- $request : mixed
- $response : mixed
- $routes : mixed
- $session : mixed
- addRoute() : Quark
- Add a route to the routes collection.
- all() : Quark
- Shorthand method for ALL methods
- app() : Quark
- Get the current Quark instance.
- applyRoute() : void
- Execute a route's callback and update request params.
- delete() : Quark
- Shorthand method to add a 'DELETE' route.
- get() : Quark
- Shorthand method to add a 'GET' route.
- middleware() : Quark
- Add a routed middleware to the stack.
- patch() : Quark
- Shorthand method to add a 'PATCH' route.
- post() : Quark
- Shorthand method to add a 'POST' route.
- put() : Quark
- Shorthand method to add a 'PUT' route.
- resetInstance() : Quark
- Create a new instance and return it This deletes the previous instance.
- start() : void
- Process all the middlewares based on a route.
- use() : Quark
- Add a routed middleware to the stack.
- __construct() : mixed
Properties
$bag
public
mixed
$bag
$instance
public
static mixed
$instance
$request
public
mixed
$request
$response
public
mixed
$response
$routes
public
mixed
$routes
= []
$session
public
mixed
$session
Methods
addRoute()
Add a route to the routes collection.
public
addRoute(Route $route) : Quark
Parameters
- $route : Route
Return values
Quark —all()
Shorthand method for ALL methods
public
all(string $path, mixed $callback) : Quark
Parameters
- $path : string
- $callback : mixed
Return values
Quark —app()
Get the current Quark instance.
public
static app() : Quark
Return values
Quark —applyRoute()
Execute a route's callback and update request params.
public
applyRoute(Route $route) : void
call_user_func requires a callable: More info: https://www.php.net/manual/en/language.types.callable.php
Parameters
- $route : Route
Return values
void —delete()
Shorthand method to add a 'DELETE' route.
public
delete(string $path, mixed $callback) : Quark
Parameters
- $path : string
- $callback : mixed
Return values
Quark —get()
Shorthand method to add a 'GET' route.
public
get(string $path, mixed $callback) : Quark
Parameters
- $path : string
- $callback : mixed
Return values
Quark —middleware()
Add a routed middleware to the stack.
public
middleware(string $path, mixed $callback[, string $params = [] ]) : Quark
Parameters
- $path : string
- $callback : mixed
- $params : string = []
Return values
Quark —patch()
Shorthand method to add a 'PATCH' route.
public
patch(string $path, mixed $callback) : Quark
Parameters
- $path : string
- $callback : mixed
Return values
Quark —post()
Shorthand method to add a 'POST' route.
public
post(string $path, mixed $callback) : Quark
Parameters
- $path : string
- $callback : mixed
Return values
Quark —put()
Shorthand method to add a 'PUT' route.
public
put(string $path, mixed $callback) : Quark
Parameters
- $path : string
- $callback : mixed
Return values
Quark —resetInstance()
Create a new instance and return it This deletes the previous instance.
public
static resetInstance() : Quark
Return values
Quark —start()
Process all the middlewares based on a route.
public
start() : void
Return values
void —use()
Add a routed middleware to the stack.
public
use(string $path, mixed $callback[, string $method = 'ALL' ]) : Quark
Parameters
- $path : string
- $callback : mixed
- $method : string = 'ALL'
Return values
Quark —__construct()
protected
__construct() : mixed