Guest User

Untitled

a guest
May 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public static function add($name, $callback)
  2. {
  3. if ( ! isset(self::$events[$name]))
  4. {
  5. // Create an empty event if it is not yet defined
  6. self::$events[$name] = array();
  7. }
  8. elseif ( ! isset(self::$events[$name][$callback]) )
  9. {
  10. // The event already exists
  11. return FALSE;
  12. }
  13.  
  14. // Add the event
  15. self::$events[$name][$callback] = $callback;
  16.  
  17. return TRUE;
  18. }
Add Comment
Please, Sign In to add comment