XmlHelper Class Reference

Public Member Functions | |
| addNs ($name, $url=null) | |
| closeElem () | |
| elem ($name, $attrib=array(), $content=null, $endTag=true) | |
| header ($attrib=array()) | |
| removeNs ($name) | |
| serialize ($data, $options=array()) | |
Public Attributes | |
| $encoding = 'UTF-8' | |
Detailed Description
Definition at line 37 of file xml.php.
Member Function Documentation
| XmlHelper::addNs | ( | $ | name, | |
| $ | url = null | |||
| ) |
Adds a namespace to any documents generated
- Parameters:
-
string $name The namespace name string $url The namespace URI; can be empty if in the default namespace map
- Returns:
- boolean False if no URL is specified, and the namespace does not exist default namespace map, otherwise true
- Deprecated:
- See also:
- Xml::addNs()
Definition at line 85 of file xml.php.
References $url.
| XmlHelper::closeElem | ( | ) |
Create closing tag for current element
- Returns:
- string
Definition at line 143 of file xml.php.
References Helper::output().
| XmlHelper::elem | ( | $ | name, | |
| $ | attrib = array(), |
|||
| $ | content = null, |
|||
| $ | endTag = true | |||
| ) |
Generates an XML element
- Parameters:
-
string $name The name of the XML element array $attrib The attributes of the XML element mixed $content XML element content boolean $endTag Whether the end tag of the element should be printed
- Returns:
- string XML
Definition at line 107 of file xml.php.
References $out, Helper::output(), and Helper::value().
Referenced by RssHelper::channel(), RssHelper::document(), and RssHelper::item().
| XmlHelper::header | ( | $ | attrib = array() |
) |
Returns an XML document header
- Parameters:
-
array $attrib Header tag attributes
- Returns:
- string XML header
Definition at line 61 of file xml.php.
References Helper::output(), and Configure::read().
Referenced by serialize().
| XmlHelper::removeNs | ( | $ | name | ) |
Removes a namespace added in addNs()
- Parameters:
-
string $name The namespace name or URI
- Deprecated:
- See also:
- Xml::removeNs()
| XmlHelper::serialize | ( | $ | data, | |
| $ | options = array() | |||
| ) |
Serializes a model resultset into XML
- Parameters:
-
mixed $data The content to be converted to XML array $options The data formatting options
- Returns:
- string A copy of $data in XML format
Definition at line 157 of file xml.php.
References Helper::$data, and header().
Member Data Documentation
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/view/helpers/xml.php