Property | Type | Description | |
---|---|---|---|
$context | |||
$routes | |||
$scope |
Method | Description | |
---|---|---|
preprocess ( &$router ) | Preprocess. This is where you'd add new routes * | |
prerender ( &$buffer ) | This is your chance to override output. It can be called multiple times for each ->flush() invocation! * | |
preroute ( &$req, &$res ) | Preroute. This is where you would aler request, or implement things like: security etc. * | |
restrict ( string $hook, $methods, $route ) : Zaphpa_Middlware | Restrict a middleware hook to certain paths and HTTP methods. | |
shouldRun ( string $hook ) : boolean | Determine whether the current route has any route restrictions for this middleware. |
public preprocess ( &$router ) |
public prerender ( &$buffer ) |
public preroute ( &$req, &$res ) |
public restrict ( string $hook, $methods, $route ) : Zaphpa_Middlware | ||
$hook | string | A middleware hook, expecting either 'preroute' or 'prerender'. @param array $rules An associative array of paths and their allowed methods: - path: A URL route string, the same as are used in $router->addRoute(). - methods: An array of HTTP methods that are allowed, or an '*' to match all methods. @return Zaphpa_Middlware The current middleware object, to allow for chaining a la jQuery. |
return | Zaphpa_Middlware |