PHP Error

Trying to get property of non-object

/home/corpgmaxcom/public_html/protected/controllers/SiteController.php(253)

241     }
242     
243     /*
244      * ok    get a news to show
245      * recieve id of news and cat_name, title of news to rewrite url
246      */
247     public function actionNews($cat, $id, $title)
248     {
249         session_start();
250         $model = News::model()->findByPk($id);
251         
252         //active menu
253         $this->menu = $model->cat_id;
254         
255         //navigation bar
256         $this->navigation_bar = $this->navigation_bar . '<span>&raquo;</span>' . CHtml::link($model->cat->name, Yii::app()->urlManager->createUrl('site/ListNews', array('id' => $model->cat_id, 'name' => myExt::KhongDau($model->cat->name))));
257         News::model()->updateByPk($model->id, array('hits' => (($model->hits==0)?1:($model->hits+1))));
258         
259         Seo::getSeo(Seo::NEWS_PAGE);
260 
261         $this->render('pages/news', array('model' => $model));
262     }
263     
264     
265     public function actionListNews($id, $name)

Stack Trace

#9
+
 /home/corpgmaxcom/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-29 02:24:15 LiteSpeed Yii Framework/1.1.7