JSimpleXMLElement/attributes
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]
Get the an attribute of the element
Syntax[edit]
attributes($attribute=null)
Parameter Name | Default Value | Description |
---|---|---|
$attribute | null | $attribute The name of the attribute |
Returns[edit]
mixed If an attribute is given will return the attribute if it exist. If no attribute is given will return the complete attributes array
Defined in[edit]
libraries/joomla/utilities/simplexml.php
Importing[edit]
jimport( 'joomla.utilities.simplexml' );
Source Body[edit]
function attributes($attribute = null)
{
if (!isset($attribute)) {
return $this->_attributes;
}
return isset($this->_attributes[$attribute]) ? $this->_attributes[$attribute] : null;
}
Examples[edit]
Code Examples[edit]