aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/events/basic.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-12 14:28:52 -0500
committercash <cash.costello@gmail.com>2011-11-16 19:53:04 -0500
commit11aacb4f048e659d1b86a6ba229438444a186142 (patch)
treed35da1535860f8883e5c92d3571fa2090890d85a /documentation/examples/events/basic.php
parent08a2fc293a9ecb92caa778d32689b595bee1d68d (diff)
downloadelgg-11aacb4f048e659d1b86a6ba229438444a186142.tar.gz
elgg-11aacb4f048e659d1b86a6ba229438444a186142.tar.bz2
added better plugin skeleton and added documentation to some of the examples
Diffstat (limited to 'documentation/examples/events/basic.php')
-rw-r--r--documentation/examples/events/basic.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/documentation/examples/events/basic.php b/documentation/examples/events/basic.php
index 91704e60b..ca2762344 100644
--- a/documentation/examples/events/basic.php
+++ b/documentation/examples/events/basic.php
@@ -1,13 +1,17 @@
<?php
+/**
+ * This snippet demonstrates how to register for an event. It dumps the
+ * parameters that the handler receives to the screen. The third argument
+ * of the handler function is an object that is related to the event. For
+ * the 'init', 'system' eveny, it is null.
+ */
elgg_register_event_handler('init', 'system', 'example_event_handler');
-function example_event_handler($event, $type, $params) {
+function example_event_handler($event, $type, $object) {
var_dump($event);
- var_dump($object_type);
- var_dump($params);
+ var_dump($type);
+ var_dump($object);
return true;
}
-
-