PHP Class CI_Hooks, TastyIgniter

Provides a mechanism to extend the base system without hacking. Most of this class is borrowed from Paul's Extension class in ExpressionEngine.
Author: ExpressionEngine Dev Team
Show file Open project: tastyigniter/tastyigniter Class Usage Examples

Public Properties

Property Type Description
$enabled boolean Determines whether hooks are enabled
$hooks array List of all hooks set in config/hooks.php

Protected Properties

Property Type Description
$_in_progress boolean Determines whether hook is in progress, used to prevent infinte loops
$_objects array Array with class objects to use hooks methods

Public Methods

Method Description
__construct ( ) : void Class constructor
call_hook ( string $which = '' ) : boolean Call Hook

Protected Methods

Method Description
_run_hook ( array $data ) : boolean Run Hook

Method Details

__construct() public method

Class constructor
public __construct ( ) : void
return void

_run_hook() protected method

Runs a particular hook
protected _run_hook ( array $data ) : boolean
$data array Hook details
return boolean TRUE on success or FALSE on failure

call_hook() public method

Calls a particular hook. Called by CodeIgniter.php.
public call_hook ( string $which = '' ) : boolean
$which string Hook name
return boolean TRUE on success or FALSE on failure

Property Details

$_in_progress protected property

Determines whether hook is in progress, used to prevent infinte loops
protected bool $_in_progress
return boolean

$_objects protected property

Array with class objects to use hooks methods
protected array $_objects
return array

$enabled public property

Determines whether hooks are enabled
public bool $enabled
return boolean

$hooks public property

List of all hooks set in config/hooks.php
public array $hooks
return array