API16

JSimpleXMLElement/addAttribute

From Joomla! Documentation

< 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[edit]

Adds an attribute to the element



Syntax[edit]

addAttribute($name, $value)
Parameter Name Default Value Description
$name $name
$value $attrs

Defined in[edit]

libraries/joomla/utilities/simplexml.php

Importing[edit]

jimport( 'joomla.utilities.simplexml' );

Source Body[edit]

function addAttribute($name, $value)
{
        //add the attribute to the element, override if it already exists
        $this->_attributes[$name] = $value;
}



Examples[edit]

Code Examples[edit]