basic.php 482 B

123456789101112131415161718
  1. <?php
  2. /**
  3. * This snippet demonstrates how to register for an event. It dumps the
  4. * parameters that the handler receives to the screen. The third argument
  5. * of the handler function is an object that is related to the event. For
  6. * the 'init', 'system' event, it is null.
  7. */
  8. elgg_register_event_handler('init', 'system', 'example_event_handler');
  9. function example_event_handler($event, $type, $object) {
  10. var_dump($event);
  11. var_dump($type);
  12. var_dump($object);
  13. return true;
  14. }