Jump to content

Problems exporting a feed


DanielHardy

Recommended Posts


 public function feedAction()
    {
      // Change layout to blank.phtml (empty file)
      

      // Set feed values
      $array['title'] = 'Guestbook feed';
      $array['link'] = 'http://www.somewhere.com/';
      $array['description'] = 'This is guestbook feed';
      $array['charset'] = 'utf8';
      // You need to change this line to read $array['charset'] = 'utf-8'; (Note the change to the 'utf8' part)
      
      // Loop through db records and add feed items to array
      $model = $this->_getModel('/ForumForm');
      foreach($model->fetchEntries() as $one_item)
      {
        $array['entries'][] = array(
          'title' => $one_item['email'],
          'link' => 'http://www.somewhere.com/123',
          'description' => $one_item['comment']
        );
      }
            
      // Import rss feed from array
      $feed = Zend_Feed::importArray($array, 'rss');

      // Send http headers and dump the feed
      $feed->send();
    }

 

I am trying to create my own rss feed using the following example. Using user generated data passed from a database. However I am getting the following error message:

 


Method "_getModel" does not exist and was not trapped in __call() 

 

Please tell me why!?

 

Thanks

 

Dan

Link to comment
https://forums.phpfreaks.com/topic/148642-problems-exporting-a-feed/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.