Events Class

Allows you to create hook points throughout the application that any other module can tap into without hacking core code.

Summary
Events ClassAllows you to create hook points throughout the application that any other module can tap into without hacking core code.
Variables
$eventsHolds the registered events.
Functions
__construct()This if here solely for CI loading to work.
init()Loads the config/events.php file into memory so we can access it later without the disk load.
trigger()Triggers an individual event.

Variables

$events

private static $events

Holds the registered events.

Access

Private

Functions

__construct()

public function __construct()

This if here solely for CI loading to work.  Just calls the init( ) method.

Return

void

init()

public static function init()

Loads the config/events.php file into memory so we can access it later without the disk load.

trigger()

public static function trigger($event_name = null,
&$payload = null)

Triggers an individual event.

NOTE: The payload sent to the event method is a pointer to the actual data.  This means that any operations on the data will affect the original data.  Use with care.

Parameters

$event_name = A string with the name of the event to trigger.  Case sensitive.  $payload = (optional) A variable pointer to send to the event method.

Returns

void

private static $events
Holds the registered events.
public function __construct()
This if here solely for CI loading to work.
public static function init()
Loads the config/events.php file into memory so we can access it later without the disk load.
public static function trigger($event_name = null,
&$payload = null)
Triggers an individual event.
Close