API16

JEvent/update: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Method to trigger events. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span...
 
Doxiki (talk | contribs)
No edit summary
Line 17: Line 17:
!Description
!Description
|-
|-
|  
| &$args
|  
|  
|  Arguments  
|  Arguments  

Revision as of 10:11, 30 March 2010

Description

Method to trigger events.

[Edit Descripton]

Template:Description:JEvent/update

Syntax

update(&$args)
Parameter Name Default Value Description
&$args Arguments

Returns

mixed Routine return value

Defined in

libraries/joomla/event/event.php

Importing

jimport( 'joomla.event.event' );

Source Body

public function update(&$args)
{
        /*
         * First lets get the event from the argument array.  Next we will unset the
         * event argument as it has no bearing on the method to handle the event.
         */
        $event = $args['event'];
        unset($args['event']);

        /*
         * If the method to handle an event exists, call it and return its return
         * value.  If it does not exist, return null.
         */
        if (method_exists($this, $event)) {
                return call_user_func_array(array($this, $event), $args);
        } else {
                return null;
        }
}

[Edit See Also] Template:SeeAlso:JEvent/update

Examples

<CodeExamplesForm />