Class RssHelper
XML Helper class for easy output of XML structures.
XmlHelper encloses all methods needed while working with XML documents.
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: The MIT License
Location: view/helpers/rss.php
Properties summary
-
$action
publicstring
Current action. -
$base
publicstring
Base URL -
$data
publicarray
POSTed model data -
$field
publicstring
Name of the current field -
$helpers
publicarray
Helpers used by RSS Helper -
$here
publicstring
URL to current action. -
$model
publicstring
Name of the current model -
$params
publicarray
Parameter array. -
$version
publicstring
Default spec version of generated RSS
Inherited Properties
Method Summary
-
channel() public
Returns an RSSelement -
document() public
Returns an RSS document wrapped intags -
item() public
Converts an array into an- element and its contents
-
items() public
Transforms an array of data using an optional callback, and maps it to a set of
- tags
-
time() public
Converts a time in any format to an RSS time
Method Detail
channel() public ¶
channel( array $attrib = array() , mixed $elements = array() , mixed $content = null )
Returns an RSS
Parameters
- array $attrib optional array()
tag attributes - mixed $elements optional array()
- Named array elements which are converted to tags
- mixed $content optional null
- Content (
- 's belonging to this channel
Returns
An RSS
document() public ¶
document( array $attrib = array() , $content = null )
Returns an RSS document wrapped in
Parameters
- array $attrib optional array()
tag attributes - $content optional null
Returns
An RSS document
item() public ¶
item( array $att = array() , array $elements = array() )
Converts an array into an
Parameters
- array $att optional array()
- $attrib The attributes of the
- element
- array $elements optional array()
- The list of elements contained in this
Returns
An RSS
items() public ¶
items( array $items , mixed $callback = null )
Transforms an array of data using an optional callback, and maps it to a set
of
Parameters
- array $items
- The list of items to be mapped
- mixed $callback optional null
A string function name, or array containing an object and a string method name
Returns
A set of RSS
Methods inherited from XmlHelper
addNs() public deprecated ¶
addNs( string $name , string $url = null )
Adds a namespace to any documents generated
Deprecated
Parameters
- string $name
- The namespace name
- string $url optional null
- The namespace URI; can be empty if in the default namespace map
Returns
False if no URL is specified, and the namespace does not exist default namespace map, otherwise true
See
elem() public ¶
elem( string $name , array $attrib = array() , mixed $content = null , boolean $endTag = true )
Generates an XML element
Parameters
- string $name
- The name of the XML element
- array $attrib optional array()
- The attributes of the XML element
- mixed $content optional null
- XML element content
- boolean $endTag optional true
- Whether the end tag of the element should be printed
Returns
XML
header() public ¶
header( array $attrib = array() )
Returns an XML document header
Parameters
- array $attrib optional array()
- Header tag attributes
Returns
XML header
removeNs() public deprecated ¶
removeNs( string $name )
Removes a namespace added in addNs()
Deprecated
Parameters
- string $name
- The namespace name or URI
See
serialize() public ¶
serialize( mixed $data , array $options = array() )
Serializes a model resultset into XML
Parameters
- mixed $data
- The content to be converted to XML
- array $options optional array()
The data formatting options. For a list of valid options, see XmlNode::__construct().
Returns
A copy of $data in XML format