JEvent/update: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Method to trigger events.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span... |
m preparing for archive only |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
Method to trigger events. | Method to trigger events. | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 17: | Line 15: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$args | ||
| | | | ||
| Arguments | | Arguments | ||
| Line 53: | Line 51: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | |||
< | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=update | category=update | ||
category=JEvent | category=JEvent | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API16]] | |||
Latest revision as of 01:37, 25 March 2017
Description
Method to trigger events.
<! removed transcluded page call, red link never existed >
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;
}
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples