Php 内置Kohana方法,帮助开发RSS提要

Php 内置Kohana方法,帮助开发RSS提要,php,rss,kohana,Php,Rss,Kohana,我发现在Kohana框架上有一个助手可以帮助解析RSS提要 有一个可以帮助创建一个吗?使用Kohana 3中的Feed类的create()方法快速创建它。您可以在以下位置找到它的代码: system/classes/kohana/feed.php 你需要这样做 然后将该数据插入方法以生成XML: $xml = Feed::create($info, $items); 当您回送它或将它传递到相关视图时,它将为您提供: <?xml version="1.0" encoding="UTF-8"

我发现在Kohana框架上有一个助手可以帮助解析RSS提要


有一个可以帮助创建一个吗?

使用Kohana 3中的
Feed
类的
create()
方法快速创建它。您可以在以下位置找到它的代码:

system/classes/kohana/feed.php

你需要这样做

然后将该数据插入方法以生成XML:

$xml = Feed::create($info, $items);
当您
回送它或将它传递到相关视图时,它将为您提供:

<?xml version="1.0" encoding="UTF-8"?>
 <rss version="2.0">
  <channel>
  <title>Dark into the Narwhal</title>
  <pubDate>Fri, 21 Dec 2012 13:32:42 EST</pubDate>
  <description>Eating bacon, taking names and leaving fortunes</description>
  <link>http://example.com/</link>
  <copyright>The Narwhal Peon</copyright>
  <language>en-us</language>
  <ttl>7200</ttl>
  <generator>KohanaPHP</generator>
  <item>
    <title>We journey with watermelon helmets</title>
    <link>http://example.com/blog/journey-with-watermelon-helmets</link>
    <description>Dawn breaks and the wind follows soon after. 
                 We have found our supplies run low.</description>
  </item>

  <!-- the other posts will be here -->

  </channel>
</rss>

黑暗中的独角鲸
2012年12月21日星期五美国东部时间13:32:42
吃熏肉,取名字,留下财富
http://example.com/
独角鲸牡丹
美国英语
7200
科纳纳帕普
我们带着西瓜头盔旅行
http://example.com/blog/journey-with-watermelon-helmets
黎明破晓,风很快就来了。
我们发现我们的供给不足。

使用Kohana3中的
Feed
类的
create()
方法快速创建它。您可以在以下位置找到它的代码:

system/classes/kohana/feed.php

你需要这样做

然后将该数据插入方法以生成XML:

$xml = Feed::create($info, $items);
当您
回送它或将它传递到相关视图时,它将为您提供:

<?xml version="1.0" encoding="UTF-8"?>
 <rss version="2.0">
  <channel>
  <title>Dark into the Narwhal</title>
  <pubDate>Fri, 21 Dec 2012 13:32:42 EST</pubDate>
  <description>Eating bacon, taking names and leaving fortunes</description>
  <link>http://example.com/</link>
  <copyright>The Narwhal Peon</copyright>
  <language>en-us</language>
  <ttl>7200</ttl>
  <generator>KohanaPHP</generator>
  <item>
    <title>We journey with watermelon helmets</title>
    <link>http://example.com/blog/journey-with-watermelon-helmets</link>
    <description>Dawn breaks and the wind follows soon after. 
                 We have found our supplies run low.</description>
  </item>

  <!-- the other posts will be here -->

  </channel>
</rss>

黑暗中的独角鲸
2012年12月21日星期五美国东部时间13:32:42
吃熏肉,取名字,留下财富
http://example.com/
独角鲸牡丹
美国英语
7200
科纳纳帕普
我们带着西瓜头盔旅行
http://example.com/blog/journey-with-watermelon-helmets
黎明破晓,风很快就来了。
我们发现我们的供给不足。