summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/general/hooks.rst
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source/general/hooks.rst')
-rw-r--r--user_guide_src/source/general/hooks.rst10
1 files changed, 9 insertions, 1 deletions
diff --git a/user_guide_src/source/general/hooks.rst b/user_guide_src/source/general/hooks.rst
index 1046c48ae..ffe3fef39 100644
--- a/user_guide_src/source/general/hooks.rst
+++ b/user_guide_src/source/general/hooks.rst
@@ -23,7 +23,7 @@ following item in the **application/config/config.php** file::
Defining a Hook
===============
-Hooks are defined in **application/config/hooks.php** file.
+Hooks are defined in the **application/config/hooks.php** file.
Each hook is specified as an array with this prototype::
$hook['pre_controller'] = array(
@@ -56,6 +56,14 @@ defined in your associative hook array:
- **params** Any parameters you wish to pass to your script. This item
is optional.
+If you're running PHP 5.3+, you can also use lambda/anoymous functions
+(or closures) as hooks, with a simpler syntax::
+
+ $hook['post_controller'] = function()
+ {
+ /* do something here */
+ };
+
Multiple Calls to the Same Hook
===============================