PHP notice

Trying to get property of non-object

/srv/www/ylcss_web/protected/controllers/LatestNewsController.php(26)

14 
15         ));
16 
17         //    $dataProvider=new CActiveDataProvider('LatestNews');
18         $this->breadcrumbs[]='最新消息';
19         $this->render('index', array('dataProvider'=>$dataProvider ));
20     }
21 
22 
23     public function actionView($id)
24     {
25         $latestNews = LatestNews::model()->findByPk($id);
26         $title=$latestNews->title;
27 
28         $this->breadcrumbs['最新消息']='index';
29         $this->breadcrumbs[]="$title";
30 
31         $this->render('view', array('latestNews'=>$latestNews));
32     }
33     /**
34      * Returns the data model based on the primary key given in the GET variable.
35      * If the data model is not found, an HTTP exception will be raised.
36      * @param integer $id the ID of the model to be loaded
37      * @return LatestNews the loaded model
38      * @throws CHttpException

Stack Trace

#9
+
 /srv/www/ylcss_web/index.php(15): CApplication->run()
10 defined('YII_DEBUG') or define('YII_DEBUG',true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
2024-03-28 22:10:06 nginx/1.16.1 Yii Framework/1.1.18