PHP notice

Trying to get property of non-object

/home/konntakt/web/quservis.ru/public_html/protected/controllers/PostController.php(27)

15             'pagination' => array(
16                 'pageSize' => 10,
17             )
18         ));
19 
20         $this->render('index', array('models' => $models,'posts' => $posts));
21     }
22 
23     public function actionView($id)
24     {
25         $model = Post::model() -> findByPk($id);
26 
27         $this->pageTitle = Yii::app()->name.' - '.$model->title;
28         Yii::app()->clientScript->registerMetaTag($model->description, 'description');
29         Yii::app()->clientScript->registerMetaTag($model->tags, 'keywords');
30 
31         if (Yii::app()->request->url != '/post/view/'.$model->id.'/'.$model->url) {
32             throw new CHttpException(404,'Указанная запись не найдена');
33         }
34         $this->render('view', array('model' => $model));
35     }
36 
37 
38     public function material_image($id, $title, $image, $width='150', $class='material_img')
39         {

Stack Trace

#9
+
 /home/konntakt/web/quservis.ru/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 13:16:48 Apache/2.4.18 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.0.2g Yii Framework/1.1.15