我正在使用 zend_feed 生成提要,这是代码,它工作正常,但我还需要添加一些关于图像的更多信息,
$feedData = array(
'title' => $feed->feedParams['title'],
'description' => $feed->feedParams['description'],
'link' => $feed->getSiteUrl() . $feed->feedParams['link'],
'charset' => $feed->feedParams['charset'],
'url' => $feed->getSiteUrl() . $feed->feedParams['image'],
'ttl' => $feed->feedParams['ttl'],
'entries' => $feed->getFeedContent()
);
$feed = Zend_Feed::importArray($feedData, 'rss');
结果是
<image>
<url>http://local.here/assets/img/icons/feed.png</url>
<title><![CDATA[here Uutiset]]></title>
<link>http://local.here/uutiset</link>
</image>
但是我需要
<image>
<url>http://www.edilex.fi/images/rss.gif</url>
<title>Edilex</title>
<link>http://www.edilex.fi/</link>
<width>129</width>
<height>76</height>
</image>
所以我试试这个,但不工作
$feedData = array(
'title' => $feed->feedParams['title'],
'description' => $feed->feedParams['description'],
'link' => $feed->getSiteUrl() . $feed->feedParams['link'],
'charset' => $feed->feedParams['charset'],
'image' => array(
'url' => $feed->getSiteUrl() . $feed->feedParams['image'],
'width' => 120,
'hight' => 130
),
'ttl' => $feed->feedParams['ttl'],
'entries' => $feed->getFeedContent()
);
$feed = Zend_Feed::importArray($feedData, 'rss');
但它不起作用,你能告诉我我该怎么做吗