Tutorial by Examples

The hooks feature can be globally enabled/disabled by setting the following item in the application/config/config.php file: $config['enable_hooks'] = TRUE;
Hooks are defined in the application/config/hooks.php file. Each hook is specified as an array with this prototype $hook['pre_controller'] = array( 'class' => 'MyClass', 'function' => 'Myfunction', 'filename' => 'Myclass.php', 'filepath' => 'h...
pre_system Called very early during system execution. Only the benchmark and hooks class have been loaded at this point. No routing or other processes have happened. pre_controller Called immediately prior to any of your controllers being called. All base classes, routing, and security checks hav...
In application/hooks folder, create a file with name Blocker.php and paste the below code. <?php class Blocker { function Blocker(){ } /** * This function used to block the every request except allowed ip address */ function requestBlocker(){ ...
Hooks are defined in application/config/hooks.php file. Each hook is specified as an array with this prototype: $hook['pre_controller'] = array( 'class' => 'MyClass', 'function' => 'Myfunction', 'filename' => 'Myclass.php', 'filepath' => 'hooks', 'p...

Page 1 of 1