【发布时间】:2011-11-03 14:15:21
【问题描述】:
我使用 Zend 的 Zend_Feed_Rss 对象制作了一个 RSS 阅读器。它对我来说很好(使用提要 1),但我们的测试人员发现它不会在提要 2 上返回标题(见下文)。
- http://www.nu.nl/feeds/rss/algemeen.rss
-
http://rss.slashdot.org/Slashdot/slashdotScience
<?php //... if($setUp){ try{ $feed = Zend_Feed::import($this->options['feed_url']); }catch(Exception $e){ $setUp = false; $this->view->errorMsg = $this->lang['wrongRss']; } } if($setUp){ $this->view->feed = $feed; $wTitle = $feed->title(); if($this->title != $wTitle){ $this->title = $wTitle; } } //... ?>
$feed->title 和 $feed->title() 都不适用于 feed 2。
Zend_Feed_Rss 对象没有任何其他方法或属性来获取标题。谁知道怎么回事?
编辑:愚蠢的我没有正确检查 rss 提要。这是一个不起作用的 rdf 提要。条目获取正常,所以唯一不起作用的是标题。如何从 rdf 提要中获取标题? Zend 的 feed 对象似乎只支持 rss 和 Atom。
【问题讨论】:
标签: php zend-framework dom rss