CI_Hooks::call_hook PHP Method

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
    public function call_hook($which = '')
    {
        if (!$this->enabled or !isset($this->hooks[$which])) {
            return FALSE;
        }
        if (is_array($this->hooks[$which]) && !isset($this->hooks[$which]['function'])) {
            foreach ($this->hooks[$which] as $val) {
                $this->_run_hook($val);
            }
        } else {
            $this->_run_hook($this->hooks[$which]);
        }
        return TRUE;
    }

Usage Example

 protected function callHook($hook)
 {
     if ($this->enableHooks) {
         return $this->hooks->call_hook($hook);
     }
     return false;
 }
All Usage Examples Of CI_Hooks::call_hook