1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace Cube\Feed;
- class Rss extends AbstractFeed
- {
-
- public function generateFeed()
- {
-
- $output = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL
- . '<rss version="2.0">' . PHP_EOL
- . '<channel>' . PHP_EOL
- . $this->_renderArray($this->_channels);
- if ($this->_entries) {
-
- foreach ($this->_entries as $entry) {
- $output .= '<item>' . PHP_EOL;
- $elements = $entry->getElements();
- foreach ($elements as $key => $value) {
- $output .= "<$key>$value</$key>" . PHP_EOL;
- }
- $output .= '</item>' . PHP_EOL;
- }
- }
- $output .= '</channel>' . PHP_EOL
- . '</rss>';
- return $output;
- }
- }
|