Output Library

The Output Library is a small library with one main function: To send the finalized web page to the requesting browser. It is also responsible for caching your web pages, if you use that feature.

Note: This library is initialized automatically by the system so there is no need to do it manually.

Under normal circumstances you won't even notice the Output library since it works transparently without your intervention. For example, when you use the Loader library to load a view file, it's automatically passed to the Output library, which will be called automatically by revIgniter at the end of system execution. It is possible, however, for you to manually intervene with the output if you need to, using either of the two following handlers:


Permits you to manually set the final output string. Usage example:

rigSetOutput tData

Important: If you do set your output manually, it must be the last thing done in the function you call it from. For example, if you build a page in one of your controller functions, don't set the output until the end.


Permits you to manually retrieve any output that has been sent for storage in the output library. Usage example:

put rigGetOutput() into tString

Note that data will only be retrievable from this function if it has been previously sent to the output library by one of the revIgniter handlers like rigLoadView().


Permits you to manually set server headers, which the output library will send for you when outputting the final rendered display. If you don't want to overwrite the most recent header of the same type set the second (optional) parameter to FALSE. Example:

rigSetHeader "HTTP/1.0 200 OK"
rigSetHeader "HTTP/1.1 200 OK"
rigSetHeader "Cache-Control: no-store, no-cache, must-revalidate"
rigSetHeader "Cache-Control: post-check=0, pre-check=0"
rigSetHeader "Pragma: no-cache"

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.


Permits you to enable/disable the Profiler, which will display benchmark and other data at the bottom of your pages for debugging and optimization purposes.

To enable the profiler place the following handler anywhere within your Controller handlers:

rigEnableProfiler TRUE

When enabled a report will be generated and inserted at the bottom of your pages.

To disable the profiler you will use:

rigEnableProfiler FALSE


The revIgniter output library also controls caching. For more information, please see the caching documentation.