Hi,
I changed the code to following:
==========================
<? if ($this->feeds->getTotalItemCount() !== 0): ?>
<?
// Initialize the channel data array
$channel = array(
'title' => 'RSS test',
'link' => 'http://localhost',
'description' => 'Testing RSS feed',
'charset' => 'utf-8',
'items' => array()
);
?>
<? foreach ($this->feeds as $feed): ?>
<?
$channel['items'][] = array(
'title' =>
$this->escape($feed['title']),
'link' =>
$this->url(array('controller'=>'index'), 'default', true),
'description' =>
$this->escape($feed['details']),
);
?>
<? endforeach ?>
<? endif ?>
<?
$rssFeedFromArray = Zend_Feed::importArray($channel, 'rss');
$rssFeedFromArray->send();
?>
===============================
When I try to view the rss from browser, it ask me to download the
file instead of showing the feed. However the downloaded file have
empty feed (only channel information) but no items. Seems like loop is
not working. What is wrong with this code?
Thanks