本文整理汇总了PHP中feed::create方法的典型用法代码示例。如果您正苦于以下问题:PHP feed::create方法的具体用法?PHP feed::create怎么用?PHP feed::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed
的用法示例。
在下文中一共展示了feed::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_create
/**
* @test
*
* @dataProvider provider_create
*
* @covers feed::create
*
* @param string $info info to pass
* @param integer $items items to add
* @param integer $matcher output
*/
public function test_create($info, $items, $enviroment, $matcher_item, $matchers_image)
{
$this->setEnvironment($enviroment);
$this->assertTag($matcher_item, feed::create($info, $items), '', FALSE);
foreach ($matchers_image as $matcher_image) {
$this->assertTag($matcher_image, feed::create($info, $items), '', FALSE);
}
}
示例2: campaigns
public function campaigns($limit = 20)
{
$this->info['description'] = 'Spicer\'s Campaigns';
$this->info['lastBuildDate'] = date(DATE_RFC2822, Orm::factory('campaign')->where('status', 'approved')->find()->created);
$campaigns = Orm::factory('campaign')->where('status', 'approved')->find_all($limit);
foreach ($campaigns as $campaign) {
$items[] = array('title' => $campaign->name, 'link' => 'campaigns/view/' . $campaign->name, 'guid' => 'campaigns/view/' . $campaign->name, 'description' => $campaign->description, 'author' => 'admin@spicers.com.au (Spicers)', 'pubDate' => date(DATE_RFC2822, $campaign->created));
}
echo feed::create($this->info, $items);
}
示例3: index
public function index()
{
$this->template->content = new View('feed');
$this->template->title = 'Feed';
$limit = '0,20';
if (isset($_POST['limit'])) {
$limit = $_POST['limit'];
}
$messages = Message_Model::get_translated_messages($limit);
$info = array('notes' => 'This is an RSS feed of the translated SMS messages.');
$items = array();
foreach ($messages as $id => $msg) {
$items[] = array('title' => string_manipulation::xmlentities($msg['sms']), 'link' => 'http://localhost:8888/SMSTurks/feed/' . $id, 'description' => string_manipulation::xmlentities($msg['translation']), 'author' => $msg['number'], 'pubDate' => date('D, d M Y H:i:s O', strtotime($msg['received'])));
}
$this->template->content->display = feed::create($info, $items);
}
示例4: comments
public function comments()
{
header('Content-Type: text/xml; charset=UTF-8', TRUE);
if ($cache = $this->cache->get('s7n_blog_feed_comments')) {
echo $cache;
return;
}
$comments = ORM::factory('blog_comment')->orderby('id', 'desc')->find_all(20);
$info = array('title' => config::get('s7n.site_title') . ' (Latest Comments)', 'link' => url::current_site(), 'generator' => 'S7Ncms - http://www.s7n.de/');
$items = array();
foreach ($comments as $comment) {
$items[] = array('author' => html::specialchars($comment->author), 'pubDate' => date('r', strtotime($comment->date)), 'title' => 'New comment for "' . $comment->blog_post->title . '"', 'description' => html::specialchars($comment->content), 'link' => $comment->blog_post->url(), 'guid' => $comment->blog_post->url());
}
$feed = feed::create($info, $items);
$this->cache->set('s7n_blog_feed_comments', $feed);
echo $feed;
}