Skip to content

About

A simple events library for CodeIgniter

Resources

Stars

11 stars

Watchers

2 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Events

Version 1.0

Based off (unreleased) code by Eric Barnes (with his permission of course).

DESCRIPTION

Events is a simple events library for CodeIgniter (all versions)

INSTALLATION

1. Copy Events.php to your application/libraries folder.
2. Load it like normal: $this->load->library('events'); (or autoload it).

USAGE

All Events functions are static.

You can add a listener to an event with the register() function:

Events::register('event_name_here', array('class_name_or_object_ref', 'method_name'));

The second parameter of register() is an array that is callable via call_user_func.

You trigger an Event by calling the trigger() function:

$event_return = Events::trigger('event_name_here', $data, 'string');

The 3rd parameter is the type of data you wish trigger() to return. Your options are as follows:

  • ‘array’
  • ‘json’
  • ‘serialized’
  • ‘string’ (the default)

About

A simple events library for CodeIgniter

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors