Class Constructor
Instantiate an object from the FeedWriter class.
Usage
void __construct( string $title , string $description , string $link , [ integer $indent = 6 ] , [ boolean $useCDATA = false ] , [ string $encode_as = null ] , [ boolean $enable_validation = true ] ) Create a new FeedWriter class object, including some basic information required to control the input/output process and get the feed started. Parameters
string $title
A string consisting of the feed title.
string $description
A string containing a description of the feed.
string $link
A string containing a the feed link, usually a link back to the blog / website.
[ integer $indent ]
An integer value representing the level of indent to apply to the XMLWriter when outputting the feed XML.
[ boolean $useCDATA ]
true/false indicating if text elements should be outputted as CDATA.
[ string $encode_as ]
A string containing the character encoding to be applied to the XML document / feed output.
[ boolean $enable_validation ]
true/false to indicate if the feed data should be validated against the corresponding FeedConstruct class for the specified output format. This will assist with building a feed that is valid in all supported output formats
Return Values
void
Examples
Instantiate new object from the FeedWriter class, passing the title, description, link and some other configuration information.
$phpFeedWriter = new FeedWriter( 'Php FeedWriter Class v3.0', //Feed Title 'Generate Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92, RSS 0.91 compatible Feed from website or database content', //Feed Description 'http://phpfeedwriter.webmasterhub.net', //Feed Link 6, //indent true, //Use CDATA null, //encoding true //enable validation );
Related Resources
Leave a Reply
You must be logged in to post a comment.-
Recent Posts
- Php FeedWriter Database Integration Tutorial – Generate a feed from database records
- db-feed-sample.php Explained – Sample Feed Database Integration Php Script
- Output Data Types and Feed Configuration to help Control Output (HTML, CDATA, Encoding)
- Php FeedWriter Version 3.1 Update
- Using CDATA in Feed Output
Email Notifications