From e334c472fb4be44feec3a73402fc4a2b062cbfc0 Mon Sep 17 00:00:00 2001
From: admin Code Igniter's Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files.
-When Code Igniter runs it follows a specific execution process, diagramed in the Application Flow page.
-There may be instances, however, where you'd like to cause some action to take place at a particular stage in the execution process.
-For example, you might want to run a script right before your controllers get loaded, or right after, or you might want to trigger one of
+ Code Igniter's Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files.
+When Code Igniter runs it follows a specific execution process, diagramed in the Application Flow page.
+There may be instances, however, where you'd like to cause some action to take place at a particular stage in the execution process.
+For example, you might want to run a script right before your controllers get loaded, or right after, or you might want to trigger one of
your own scripts in some other location.
Notes: Notes:Hooks - Extending the Framework Core
-
$hook['pre_controller'] = array(
-
'class' => 'MyClass',
- 'function' => 'Myfunction',
+ 'function' => 'Myfunction',
'filename' => 'Myclass.php',
'filepath' => 'hooks',
'params' => array('beer', 'wine', 'snacks')
);
The array index correlates to the name of the particular hook point you want to
-use. In the above example the hook point is pre_controller. A list of hook points is found below.
+
The array index correlates to the name of the particular hook point you want to
+use. In the above example the hook point is pre_controller. A list of hook points is found below.
The following items should be defined in your associative hook array:
@@ -109,7 +109,7 @@ The following items should be defined in your associative hook array:
$hook['pre_controller'][] = array(
'class' => 'MyClass',
- 'function' => 'Myfunction',
+ 'function' => 'Myfunction',
'filename' => 'Myclass.php',
'filepath' => 'hooks',
'params' => array('beer', 'wine', 'snacks')
@@ -117,7 +117,7 @@ $hook['pre_controller'][] = array(
$hook['pre_controller'][] = array(
'class' => 'MyOtherClass',
- 'function' => 'MyOtherfunction',
+ 'function' => 'MyOtherfunction',
'filename' => 'Myotherclass.php',
'filepath' => 'hooks',
'params' => array('red', 'yellow', 'blue')
@@ -149,7 +149,7 @@ Called immediately after your controller is instantiated, but prior to any metho
Called immediately after your controller is fully executed.
display_override
-Overrides the _display() function, used to send the finalized page to the web browser at the end of system execution. This permits you to
+Overrides the _display() function, used to send the finalized page to the web browser at the end of system execution. This permits you to
use your own display methodology. Note that the finalized data will be available by calling $this->output->get_output()
cache_override
--
cgit v1.2.3-24-g4f1b