Actions

API16

JSimpleXMLElement/map

< API16:JSimpleXMLElement

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

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



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



Examples

Code Examples


Advertisement