1
    //CODE
    $entries = $model->fetchEntries();

    $feedUri = '/rss/';
    //link from which feed is available
    $link = 'http://' . $_SERVER['HTTP_HOST'] . $feedUri;


    $feedArray = array(
            'title' => 'Student\'s Movie Club - Upcoming Movies',
            'link' => $link,
            'description' => 'Upcoming Movies',
            'language' => 'en-us',
            'charset' => 'utf-8',
            'pubDate' => $entries[0]['created'],
            'generator' => 'Zend Framework Zend_Feed',
            'entries' => array()
        );

    foreach ($entries as $movie) {
        $feedArray['entries'][] = array(
            'title' => $movie['movie_title'],
            'link' => '/movie/view/id/'.$movie['id'],
            'description' => $move['movie_review'],
            'pubDate' => $movie['created'],
            'guid' => 'http://' . $_SERVER['HTTP_HOST'] .'/movie/view/id/'.$movie['id']
             );
        }

    //var_dump($feedArray);
    //die();
    $feed = Zend_Feed::importArray($feedArray, 'rss');
    $feed->send();
    //~CODE

此消息引发异常:

An error occurred
Application error
Exception information:

Message: description key is missing

Stack trace:

#0 C:\wwwroot\projects\studyhood\project2\library\Zend\Feed\Builder.php(182): Zend_Feed_Builder->_createEntries(Array)
#1 C:\wwwroot\projects\studyhood\project2\library\Zend\Feed.php(385): 

任何帮助表示赞赏...

4

1 回答 1

2

我相信这是你的问题:

'description' => $move['movie_review'],

查看 $movie 的拼写 :) 将您的代码更改为:

foreach ($entries as $movie) {
        $feedArray['entries'][] = array(
            'title' => $movie['movie_title'],
            'link' => '/movie/view/id/'.$movie['id'],
            'description' => $movie['movie_review'],
            'pubDate' => $movie['created'],
            'guid' => 'http://' . $_SERVER['HTTP_HOST'] .'/movie/view/id/'.$movie['id']
             );
}
于 2009-06-23T19:21:18.020 回答