Zend_Feed “描述密钥丢失”
//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):
任何帮助表示赞赏...
//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
There is an exception thrown with this message:
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):
Any help appreciated...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信这是你的问题:
看看 $movie 的拼写:) 将你的代码更改为:
I believe this is your problem:
Look at the speling of $movie :) Change your code to this: