Prev |  | Next

### 2.2.5. Hook functions

A module contains PHP functions that act as hook functions. Hook functions will receive some data from Phorum through their arguments and have to return the (possibly modified) data, which will then go either back to Phorum or to the input of another module which also handles the same hook (see ???). Based on this, the most basic (and useless) hook function you could write would look somewhat like this (see XXX for an explanation of the naming scheme that was used for the function):

    function phorum_mod_foo_some_hook ($data) {
      return $data;
    }

The exact nature of the data that is sent to the hook functions depends solely on the hook that is run. See Chapter 3, Module hooks for a description of all supported hooks, including a specification of the type of data that is sent.

Prev | Up | Next
| Home |