本文整理汇总了PHP中RSSFeed::compile方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::compile方法的具体用法?PHP RSSFeed::compile怎么用?PHP RSSFeed::compile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSSFeed
的用法示例。
在下文中一共展示了RSSFeed::compile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
</rss>';
return $rss;
}
}
$newsData = array('title' => 'GIT repository for the source', 'content' => 'The source code for my site is now on GitHub, so if you are interested on how my site is build the URL is:
<a href="http://github.com/high/cgeek">http://github.com/high/cgeek</a>.', 'created' => mktime(0, 0, 0, 3, 14, 2009));
$newsItem = new NewsItem();
$newsItem->loadData($newsData);
$newsItems[] = $newsItem;
$newsData = array('title' => 'New site is up', 'content' => 'Well, here is the new site. My goal is to make it as simple as possible and just display the things that are essential to me', 'created' => mktime(0, 0, 0, 3, 12, 2010));
$newsItem = new NewsItem();
$newsItem->loadData($newsData);
$newsItems[] = $newsItem;
$rss = new RSSFeed();
$rss->setNewsItems($newsItems);
$rssText = $rss->compile();
file_put_contents("rss.xml", $rssText);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>High's page</title>
<link rel="stylesheet" type="text/css" href="site.css"></link>
</head>
<body>
<div id="content">
<div id="title">