XmlHelper
class XmlHelper (View source)
Simple Xml Helper to get attributes from \SimpleXMLElement
Methods
Get attribute from SimpleXMLElement.
Get attribute from SimpleXMLElement. Alias of getAttribute()
.
Method to convert some string like true
, 1
, yes
to boolean TRUE,
and no
, false
, disabled
, null
, none
, 0
string to boolean FALSE.
Just an alias of getBool()
but FALSE will return TRUE.
If this attribute not exists, use this value as default, or we use original value from xml.
Details
at line line 52
static mixed
getAttribute(SimpleXMLElement $xml, string $attr, mixed $default = null)
Get attribute from SimpleXMLElement.
at line line 71
static mixed
get(SimpleXMLElement $xml, string $attr, mixed $default = null)
Get attribute from SimpleXMLElement. Alias of getAttribute()
.
at line line 86
static mixed
getBool(SimpleXMLElement $xml, string $attr, mixed $default = null)
Method to convert some string like true
, 1
, yes
to boolean TRUE,
and no
, false
, disabled
, null
, none
, 0
string to boolean FALSE.
at line line 107
static mixed
getFalse(SimpleXMLElement $xml, string $attr, mixed $default = null)
Just an alias of getBool()
but FALSE will return TRUE.
at line line 119
static array
getAttributes(SimpleXMLElement $xml)
Get all attributes.
at line line 140
static void
def(SimpleXMLElement $xml, string $attr, string $value)
If this attribute not exists, use this value as default, or we use original value from xml.