Registering Hooks

Register a hook in your extension class as follows:

on ( hook-name, [ $this, "function-name"], [ condition ] )

where:

hook-name

is one of the supplied Hook constants - Hook::INIT, for example.

function-name

Is the name of a function in your extension class. This is the callback function that will be executed when the hook is called.

condition

Is an optional Boolean expression that determines whether or not function-name will actually be called. The default value of condition is true, so if you don't specify a condition then function-name will always be called.