PHP notice

Trying to get property of non-object

/home/vladnews/data/www/radiolemma.ru/htdocs/protected/modules/front/controllers/LeadingController.php(29)

17         $leadings = Leading::model()->active()->search();
18         if (!$leadings) {
19             throw new CHttpException(404, 'Страница не найдена');
20         }
21         $this->render('index', array('leadings' => $leadings));
22 
23     }
24 
25 
26     public function actionView($id)
27     {
28         $leading = Leading::model()->active()->findByPk($id);
29         $this->metaTitle = $leading->fio;
30         $this->breadcrumbs[] = $leading->fio;
31         $this->openGraph['title'] = $leading->fio;
32         $this->openGraph['url'] = Yii::app()->params['siteUrl'] . Yii::app()->params['leadingPref'] . $leading->id;
33         $this->openGraph['description'] = str_replace('"', "'", $leading->teaser);
34         $this->openGraph['article'] = 'article';
35         $this->render('view', array('leading' => $leading));
36     }
37 
38 }

Stack Trace

#9
+
 /home/vladnews/data/www/radiolemma.ru/htdocs/index.php(22): CApplication->run()
17 
18 
19 require_once($yii);
20 
21 
22 Yii::createWebApplication($config)->run();
2024-03-19 20:50:50 nginx/1.10.3 Yii Framework/1.1.14