API15

Difference between revisions of "JObserver/ construct"

From Joomla! Documentation

< API15:JObserver
(New page: ===Description=== Constructor <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> ...)
 
Line 17: Line 17:
 
!Description
 
!Description
 
|-
 
|-
|  
+
| &$subject
 
|  
 
|  
 
|   
 
|   

Revision as of 12:28, 25 March 2010

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Constructor

[Edit Descripton]

Template:Description:JObserver/ construct

Syntax[edit]

__construct(&$subject)
Parameter Name Default Value Description
&$subject

Defined in[edit]

libraries/joomla/base/observer.php

Importing[edit]

jimport( 'joomla.base.observer' );

Source Body[edit]

function __construct(& $subject)
{
        // Register the observer ($this) so we can be notified
        $subject->attach($this);

        // Set the subject to observe
        $this->_subject = & $subject;
}

[Edit See Also] Template:SeeAlso:JObserver/ construct

Examples[edit]

<CodeExamplesForm />