Actions

API16

JSimpleXMLElement/map

From Joomla! Documentation

< API16:JSimpleXMLElement
Revision as of 16:56, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

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

[Edit Descripton]

Description:JSimpleXMLElement/map

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

[Edit See Also] SeeAlso:JSimpleXMLElement/map

Examples

<CodeExamplesForm />