This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Library_Events

Direct known subclasses


Package: Core
Copyright: Copyright (c) 2003-2008 Concrete5. (
License: MIT License
Author: Andrew Embler
Located at core/libraries/events.php

Methods summary

public static
# enableEvents( )

Enables events if they haven't been enabled yet. This happens automatically if a particular 3rd party addon requires it

public static
# getInstance( )

Returns an instance of the systemwide Events object.

public static
# extendPageType( $ctHandle, $event = false, $params = array() )

When passed an "event" as a string, a user-defined method will be run INSIDE this page's controller whenever an event takes place. The name/location of this event is not customizable. If you want more customization, used extend() below.

public static
# extend( string $event, string $class, string $method = '', string $filename = '', array $params = array(), $priority = 5 )

When passed an "event" as a string (e.g. "on_user_add"), a user-defined method can be run whenever this event takes place.

Events::extend('on_user_add', 'MySpecialClass', 'createSpecialUserInfo', 'models/my_special_class.php', array('foo' => 'bar'))
public static
# fire( string $event )

An internal function used by Concrete to "fire" a system-wide event. Any time this happens, events that a developer has hooked into will be run.

protected static
# sortByPriority( )

Sorts registered events by priority

public static number|number|number
# comparePriority( array $a, array $b )

compare function to be used with usort for sorting the events by priority

Constants summary

# "page_type"
# "global"

Properties summary

protected array $registeredEvents
# array()