aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/hooks/register/advanced.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-09-15 15:40:51 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-09-15 15:40:51 +0000
commitea4403c9240c3778cddc90d48d0a59c4d47dd2d8 (patch)
treed62822795c186d7de87f3f5e337283d8007dae2a /documentation/examples/hooks/register/advanced.php
parent4d008fefd2882a51309b5c6a7c3c7775fb34270d (diff)
downloadelgg-ea4403c9240c3778cddc90d48d0a59c4d47dd2d8.tar.gz
elgg-ea4403c9240c3778cddc90d48d0a59c4d47dd2d8.tar.bz2
Adding documentation and examples.
git-svn-id: http://code.elgg.org/elgg/trunk@6933 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'documentation/examples/hooks/register/advanced.php')
-rw-r--r--documentation/examples/hooks/register/advanced.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/documentation/examples/hooks/register/advanced.php b/documentation/examples/hooks/register/advanced.php
new file mode 100644
index 000000000..48cddd480
--- /dev/null
+++ b/documentation/examples/hooks/register/advanced.php
@@ -0,0 +1,23 @@
+<?php
+
+// the output:page hook is triggered by page_draw().
+register_plugin_hook('output', 'page', 'example_plugin_hook_handler', 600)
+register_plugin_hook('output', 'page', 'example_plugin_hook_handler_2', 601);
+
+function example_plugin_hook_handler($event, $type, $value, $params) {
+ // change A to @
+ $value = str_replace('A', '@', $value);
+
+ return $value
+}
+
+function example_plugin_hook_handler($event, $type, $value, $params) {
+ // change S to $
+ $value = str_replace('S', '$', $value);
+
+ return $value
+}
+
+$content = 'This is some Sample Content.';
+
+page_draw('Title', $content);