Tutorials > Processing
Sometimes you may want to insert your own custom code at various points in BoltWire's processing. It provides four easy hooks you can use: startup, pre, post, background.
To use one, put a line like the following in config.php or your plugin:
$BOLTprocess['hook'] = 'function_name';
When BoltWire hits the hook you specified it will call your function (which you also need to define).
Note: The startup hook (and function) must be defined in index.php before calling the engine as it occurs in the initialization routine before config.php or any plugins are loaded.
Here are the four hooks and when they occur in BoltWire's startup routine. For a detailed look at BoltWire's startup routine, click here.
STARTUP This occurs very early in the markup table. Basically nothing has been done except load BoltWire's core scripts. PRE All the initialization variables have been set. BoltWire is about to do form processing (if needed) and begin construction of the actual page. POST Page construction has been completed. All we have left to do is send it back to the browser. BACKGROUND BoltWire sends the page back to the browser and attempts to disconnect. This allows for more time consuming processes.
Note: Additional custom code can also be inserted in index.php before calling the engine if necessary.