Hi guys i m new to YII. i m using Yii1.1.6,windows,morzilla6.0,php5.0
I want to implement RSS feed in my application I follwed this url http://www.yiiframework.com/wiki/20/
I have table tbl_advert, AR, CRUD file for this table i have created
Steps i have done
1-downloded Zend framwork files
2-I put 'library / feed ’ folder in my app in protected/vendors/feed
3-In main/config file in ‘import’ section included this vendor like
'import'=>array(
'application.vendors.*',
),
4-In my AdvertController i put one action field like this—
public function actionFeed()
{
// retrieve the latest 20 posts
$posts=Advert::model()->findAll(array(
'order'=>'until_date DESC',
'limit'=>5,
));
$entries=array();
// convert to the format needed by Zend_Feed
foreach($posts as $post)
{
if($post->adv_description_short==''){
$post->adv_description_short="Empty";
}
$entries[]=array(
'title'=>$post->adv_title,
'link'=>htmlentities($this->createUrl('advert/deal',array('id'=>$post->idtbl_advert))),
'description'=>$post->adv_description_short,
'lastUpdate'=>$post->from_date,
);
}
/*echo phpinfo();exit;
echo '<pre>';
print_r($entries);
echo '</pre>';*/
// generate and render RSS feed
$feed=Zend_Feed::importArray(array(
'title' => 'My Post Feed',
'link' => $this->createUrl(''),
'charset' => 'UTF-8',
'description'=>'My Advert',
'entries' =>$entries
), 'rss');
$feed->send();
}
in browser(http://121.242.65.82:8087/Advert/feed) i m getting following error(
[html]include(DOMDocument.php) [<a href="function.include">function.include</a>]: failed to open
stream: No such file or directory<div>/var/www/html/wikiwin/framework/YiiBase.php(421)</div><pre>{
<span class="ln">410</span> foreach(self::$_includePaths as $path)
<span class="ln">411</span> {
<span class=“ln”>412</span> $classFile=$path.DIRECTORY_SEPARATOR.$className.’.php’;
<span class="ln">413</span> if(is_file($classFile))
<span class="ln">414</span> {
<span class="ln">415</span> include($classFile);
<span class="ln">416</span> break;
<span class="ln">417</span> }
<span class="ln">418</span> }
<span class="ln">419</span> }
<span class="ln">420</span> else
<span class=“error”><span class=“ln error-ln”>421</span> include($className.’.php’); </span></pre><div><span class=“Apple-style-span” style="font-family: monospace; white-space: pre; "><span class=“ln”>422</span> }</span>[/html]</div><div> Plz help ASAP?
thanx
</div>