JSimpleXMLElement/map: Difference between revisions
From Joomla! Documentation
New page: ===Description===
traverses the tree calling the $callback( JSimpleXMLElement $this, mixed $args=array() ) function with each JSimpleXMLElement.
<span class="editsection" style="font-si... |
m removing red link to edit, no existant pages |
||
| Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 47: | Line 47: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Examples=== | ===Examples=== | ||
| Line 62: | Line 62: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API15]] | |||
Revision as of 18:50, 12 May 2013
Description
traverses the tree calling the $callback( JSimpleXMLElement $this, mixed $args=array() ) function with each JSimpleXMLElement.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
map($callback, $args=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $callback | $callback function name | |
| $args | array() | $args |
Defined in
libraries/joomla/utilities/simplexml.php
Importing
jimport( 'joomla.utilities.simplexml' );
Source Body
function map($callback, $args=array())
{
$callback($this, $args);
// Map to all children
if ($n = count($this->_children)) {
for($i=0;$i<$n;$i++)
{
$this->_children[$i]->map($callback, $args);
}
}
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />