Common Handlers

revIgniter uses a few handlers for its operation that are available to you at any point. These do not require loading any libraries or helpers.

rigFetchConfigItem("Item", "Index")

The Config library is the preferred way of accessing configuration information, however rigFetchConfigItem() can be used to retrieve single keys. See Config library documentation for more information.

rigShowError "message"

rigShow404 "page"

rigLogMessage "level", "message"

rigDoException contexts, "currentFile", "currentHandler"

These are each outlined on the Error Handling page.

rigSetStatusHeader code, "text"

Permits you to manually set a server status header. Example:

rigSetStatusHeader 401
# Sets the header as: Unauthorized

See here for a full list of headers.

rigNonce()

Generates a random string unique for each request as used by Content-Security-Policy response headers.
Example:

put "'nonce-" & rigNonce() & "'" into tSrcNonce
# GENERATE A Content-Security-Policy META TAG TO BE USED IN THE HEADER
put "Content-Security-Policy" into tCspMetaA["name"]
put "style-src 'self'" && tSrcNonce into tCspMetaA["content"]
put "equiv" into tCspMetaA["type"]
put rigHtmlMeta(tCspMetaA) into gData["cspTag"]

Add csp nonce to your view file.

[[gData["cspTag"]]] <!-- see above -->

<style nonce="<? return rigNonce() ?>" type="text/css">
body {
 ...
}
...
</style>