Support Joomla!

references:joomla.framework:base:jobserver-__construct

Table of Contents

__construct

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Base Class JObserver Method __construct Reference __construct() Never Work in Progress

This is the class constructor. It performs two function: first, it registers itself with the subject so that the subject knows to notify this observer. Second, it sets up the subject property so that this object can reference the subject it is observing.

Syntax

JObserver __construct ( &$subject )

$subject string is an object whose class is a child class of the JObservable class.

Examples

The JEventDispatcher::register function instantiates a JObserver class (or subclass) by passing itself to the JObserver constructor:

Example

$this->attach(new $handler($this));
 
references/joomla.framework/base/jobserver-__construct.txt (356 views) · Last modified: 2007/08/15 15:08