- Symphony 2.2.1
-
› boot
9 -
› core
22 -
› email-gateways
3 -
› toolkit
66 -
› Unknown
33 - Delegates83
- Deprecated30
Versions
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.3
- 2.7.2
- 2.7.10
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.11
- 2.6.10
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
Options
public class XMLElement
class.xmlelement.php #14XMLElement is a class used to simulate PHP's DOMElement class. Each object is a representation of a HTML element and can store it's children in an array. When an XMLElement is generated, it is output as an XML string.
Constants
static string CRLF = PHP_EOL
The end-of-line constant.
Deprecated
This will be removed in the next version of Symphony
Methods
XMLElement __construct(
$name, $value, $attributes, $createHandle)
The constructor for the XMLElement
Parameters
void addProcessingInstruction(
$pi)
Adds processing instructions to this XMLElement
void appendChild(XMLElement $child)
Adds an XMLElement to the children array
void appendChildArray(
$children)
A convenience method to add children to an XMLElement quickly.
string generate(
$indent, $tab_depth, $hasParent)
This function will turn the XMLElement into a string representing the element as it would appear in the markup. It is valid XML.
Parameters
string getAttribute(
$name)
Retrieves the value of an attribute by name
array getAttributes()
Accessor for $_attributes
array getChildren()
Accessor for $_children
string getName()
Accessor for $_name
integer getNumberOfChildren()
Returns the number of children this XMLElement has.
string|XMLElement getValue()
Accessor for $_value
void prependChild(XMLElement $child)
Adds an XMLElement to the start of the children array, this will mean it is output before any other children when the XMLElement is generated
void setAllowEmptyAttributes(
$value)
Specifies whether attributes need to have a value or if they can be shorthand on this XMLElement.
Parameters
void setAttribute(
$name, $value)
Sets an attribute
Parameters
void setAttributeArray(
$attributes)
A convenience method to quickly add multiple attributes to an XMLElement
Parameters
void setDTD(
$dtd)
Sets the DTD for this XMLElement
void setElementStyle(
$style)
Sets the style of the XMLElement. Used when the XMLElement is being generated to determine whether needs to be closed, is self closing or is standalone.
Parameters
void setEncoding(
$value)
Sets the encoding for this XMLElement for when it's generated.
void setIncludeHeader(
$value)
Sets whether this XMLElement needs to output an XML declaration or not. This normally is only set to true for the parent XMLElement, eg. 'html'.
Parameters
void setSelfClosingTag(
$value)
Sets whether this XMLElement is self closing or not.
Parameters
void setValue(
$value, $prepend)
Sets the value of the XMLElement. Checks to see whether the value should be prepended or appended to the children.
Parameters
void setVersion(
$value)
Sets the version for the XML declaration of this XMLElement