Location: PHPKode > projects > DIY Blog > diy-blog/classes/diy-blog/frontend/view/rss/RSSView.class.php
<?php

/**
 * Blog post listing as RSS 1.0 feed.
 * @package diy-blog.frontend.view.rss
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

class RSSView extends XSLTView
{
	protected static $outputType = ContentType::APPLICATION_RDF_XML;

	public function __construct(Resource $resource = null)
	{
		parent::__construct($resource);

		$this->template->load(APP_VIEW_DIR."rss/RSS.xsl");
		$this->resolver = new URIResolver("arg");
	}

	function display(Request $request, Response $response)
	{
		$c = new Criteria();
		$c->add(PagePeer::TYPE, PagePeer::CLASSKEY_POSTPAGE);

		//$c->setLimit($limit);
		//$c->setOffset($offset);
		$c->addDescendingOrderByColumn(PagePeer::DATETIME);

		$posts = PagePeer::doSelectJoinAll($c);

		$this->proc->setParameter("", "time-difference", date("P"));
		$this->proc->setParameter("", "uri", $request->getAttribute("URI"));
		$this->proc->setParameter("", "host-uri", FrontEndMapping::getHost()); // QUIRK

		$this->resolver->setArgument("posts", XMLSerializer::serialize($posts));

		parent::display($request, $response);

		$response->setCharacterEncoding("UTF-8");
		$response->setContentType(self::$outputType);
		$response->setStatus(Response::SC_OK);
	}

}

?>
Return current item: DIY Blog