2009-06-02 2 views

답변

3

채찍 그것을 다음에 그것의 코드를 확인할 수있는 것들 :

시스템/클래스/kohana/피드. PHP

define the channel information and its feed items as a minimum이 필요합니다.

<?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> 
+0

: 당신 echo 그것을 밖으로 또는 관련 뷰에 전달할 때

$xml = Feed::create($info, $items); 

당신이 줄 것이다 :

$info = array( 'title' => 'Dark into the Narwhal', 'pubDate' => date("D, d M Y H:i:s T"), 'description' => 'Eating bacon, taking names and leaving fortunes', 'link' => 'http://example.com/', 'copyright' => 'The Narwhal Peon', 'language' => 'en-us', 'ttl' => '7200', ); $items = array( array( 'title' => 'We journey with watermelon helmets', 'link' => 'blog/journey-with-watermelon-helmets', 'description' => 'Dawn breaks and the wind follows soon after. We have found our supplies run low.', ), //-- and the other posts you want to include ); 

그런 다음 XML을 생성하는 방법으로 데이터 연결 굉장해, 고마워! – alex