本文整理汇总了PHP中RSSFeed::renderWith方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::renderWith方法的具体用法?PHP RSSFeed::renderWith怎么用?PHP RSSFeed::renderWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSSFeed
的用法示例。
在下文中一共展示了RSSFeed::renderWith方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rss
public function rss()
{
$this->setDefaultView();
$events = $this->Events();
foreach ($events as $event) {
$event->Title = strip_tags($event->DateRange()) . " : " . $event->getTitle();
$event->Description = $event->getContent();
}
$rss_title = $this->RSSTitle ? $this->RSSTitle : sprintf(_t("Calendar.UPCOMINGEVENTSFOR", "Upcoming Events for %s"), $this->Title);
$rss = new RSSFeed($events, $this->Link(), $rss_title, "", "Title", "Description");
if (is_int($rss->lastModified)) {
HTTP::register_modification_timestamp($rss->lastModified);
header('Last-Modified: ' . gmdate("D, d M Y H:i:s", $rss->lastModified) . ' GMT');
}
if (!empty($rss->etag)) {
HTTP::register_etag($rss->etag);
}
$xml = str_replace(' ', ' ', $rss->renderWith('RSSFeed'));
$xml = preg_replace('/<!--(.|\\s)*?-->/', '', $xml);
$xml = trim($xml);
HTTP::add_cache_headers();
$this->getResponse()->addHeader('Content-Type', 'application/rss+xml');
echo $xml;
}
示例2: rss
public function rss()
{
$events = $this->getModel()->UpcomingEvents(null, $this->DefaultEventDisplay);
foreach ($events as $event) {
$event->Title = strip_tags($event->_Dates()) . " : " . $event->EventTitle();
$event->Description = $event->EventContent();
}
$rss = new RSSFeed($events, $this->Link(), sprintf(_t("Calendar.UPCOMINGEVENTSFOR", "Upcoming Events for %s"), $this->Title), "", "Title", "Description");
if (is_int($rss->lastModified)) {
HTTP::register_modification_timestamp($rss->lastModified);
header('Last-Modified: ' . gmdate("D, d M Y H:i:s", $rss->lastModified) . ' GMT');
}
if (!empty($rss->etag)) {
HTTP::register_etag($rss->etag);
}
$xml = str_replace(' ', ' ', $rss->renderWith('RSSFeed'));
$xml = preg_replace('/<!--(.|\\s)*?-->/', '', $xml);
$xml = trim($xml);
HTTP::add_cache_headers();
header("Content-type: text/xml");
echo $xml;
}