Event_Dispatcher::addObserver()

Event_Dispatcher::addObserver() -- Add a new observer.

Synopsis

require_once 'Event/Dispatcher.php';

void Event_Dispatcher::addObserver (mixed $callback [, string $nName = EVENT_DISPATCHER_GLOBAL [, string $class = '']])

Description

Adds a new observer to the dispatcher.

Observers are PHP callbacks. That means you may either pass a function name as a string or an array containing an object or class and a method to call.

The callback is used as a signature for the observer, which allows you to remove it by passing the exact same parameters to removeObserver().

Parameter

Return value

void

Note

This function can not be called statically.