API16

JSimpleXMLElement/map

From Joomla! Documentation

< API16:JSimpleXMLElement
Revision as of 17:56, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== traverses the tree calling the $callback(JSimpleXMLElement $this, mixed $args=array()) function with each JSimpleXMLElement. <span class="editsection" style="font-size...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The "API16" 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]

traverses the tree calling the $callback(JSimpleXMLElement $this, mixed $args=array()) function with each JSimpleXMLElement.

[Edit Descripton]

Template:Description:JSimpleXMLElement/map

Syntax[edit]

map($callback, $args=array())
Parameter Name Default Value Description
$callback $callback function name
$args array() $args

Defined in[edit]

libraries/joomla/utilities/simplexml.php

Importing[edit]

jimport( 'joomla.utilities.simplexml' );

Source Body[edit]

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);
                }
        }
}

[Edit See Also] Template:SeeAlso:JSimpleXMLElement/map

Examples[edit]

<CodeExamplesForm />