Plugin request callbacks
In general, you just need to use the
respond() function to create request handlers. However, if you’re implementing features which affect all your request handlers, such as authentication systems, you may find these callbacks useful.
Interface (for overriding)
Define your own implementations of these functions by including them in the
O.plugin(), or add functions after the object has been created.
Called before a request is handled.
E is an
To abort the request handling, either return
false to generate a 403 Forbidden response, or generate a response in the callback. Just as in the request handler itself, you can use
E.render() or the
kind properties of
If a response is generated and
false is returned, the generated response will be used.
This callback is useful for enforcing permissions, for example, checking that the current user is a member of a particular group.
function requestBeforeRender(E, view, templateName)
Called before a template is rendered using
E.render() in a request handler.
E is an
view is the view about to be rendered, and
templateName is the name of the template which will be used.
This callback function may modify the