Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function add($name, $callback)
- {
- if ( ! isset(self::$events[$name]))
- {
- // Create an empty event if it is not yet defined
- self::$events[$name] = array();
- }
- elseif ( ! isset(self::$events[$name][$callback]) )
- {
- // The event already exists
- return FALSE;
- }
- // Add the event
- self::$events[$name][$callback] = $callback;
- return TRUE;
- }
Add Comment
Please, Sign In to add comment