JXMLElement/name: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Get the name of the element. Warning: don't use getName() as it's broken up to php 5.2.3
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Descri... |
m preparing for archive only |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
Get the name of the element. Warning: don't use getName() as it's broken up to php 5.2.3 | Get the name of the element. Warning: don't use getName() as it's broken up to php 5.2.3 | ||
===Syntax=== | ===Syntax=== | ||
| Line 34: | Line 32: | ||
</source> | </source> | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=name | category=name | ||
category=JXMLElement | category=JXMLElement | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 02:18, 25 March 2017
Description
Get the name of the element. Warning: don't use getName() as it's broken up to php 5.2.3
Syntax
name()
Returns
string
Defined in
libraries/joomla/utilities/xmlelement.php
Importing
jimport( 'joomla.utilities.xmlelement' );
Source Body
public function name()
{
if(version_compare(phpversion(), '5.2.3', '>'))
{
return (string)$this->getName();
}
// workaround php bug number 41867, fixed in 5.2.4
return (string)$this->aaa->getName();
}
demo.xml
Output: