- Symphony 2.2
-
› boot
9 -
› core
22 -
› email-gateways
3 -
› toolkit
67 -
› Unknown
33 - Delegates82
- Deprecated28
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 #11XMLElement 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()
The constructor for the XMLElement
Parameters
void addProcessingInstruction()
Adds processing instructions to this XMLElement
void appendChild()
Adds an XMLElement to the children array
void appendChildArray()
A convenience method to add children to an XMLElement quickly.
string generate()
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()
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()
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()
Specifies whether attributes need to have a value or if they can be shorthand on this XMLElement.
Parameters
void setAttribute()
Sets an attribute
Parameters
void setAttributeArray()
A convenience method to quickly add multiple attributes to an XMLElement
Parameters
void setDTD()
Sets the DTD for this XMLElement
void setElementStyle()
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()
Sets the encoding for this XMLElement for when it's generated.
void setIncludeHeader()
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()
Sets whether this XMLElement is self closing or not.
Parameters
void setValue()
Sets the value of the XMLElement. Checks to see whether the value should be prepended or appended to the children.
Parameters
void setVersion()
Sets the version for the XML declaration of this XMLElement