PHP Error

Trying to get property of non-object

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

241         else 
242         {
243             Yii::app()->language = Yii::app()->session['lang'];
244         }
245         
246         
247         $model = News::model()->findByPk($id);
248         
249         //active menu
250         $this->menu = $model->cat_id;
251         
252         //navigation bar
253         if ($model->cat->cat->parent != 0)
254         {
255             $this->navigation_bar = $this->navigation_bar . '<span>&raquo;</span>' . CatNews::getPath($model->cat->cat->parent);
256             $this->navigation_bar = $this->navigation_bar . '<span>&raquo;</span>' . CatNews::getPath($model->cat->parent);
257             $this->cat_id = $model->cat->cat->parent;
258             $this->sub_id = $model->cat_id;
259         }
260         else 
261         {
262             if ($model->cat->parent != 0)
263             {
264                 $this->navigation_bar = $this->navigation_bar . '<span>&raquo;</span>' . CatNews::getPath($model->cat->parent);
265                 $this->cat_id = $model->cat->parent;

Stack Trace

#9
+
 /home/hoangminhuk/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-28 23:24:33 LiteSpeed Yii Framework/1.1.7