PHP notice

Trying to get property of non-object

/var/www/vhosts/val.ua/protected/views/site/single.php(3)

01 <?php
02 
03 $this->pageTitle = Yii::app()->language == 'ru' ? $data->meta_title_ru : $data->meta_title_uk;
04 $this->pageDescription = Yii::app()->language == 'ru' ? $data->meta_description_ru : $data->meta_description_uk;
05 
06 $this->metaAttributes[] = '<meta property="og:image" content="https://val.ua'.Yii::app()->baseUrl.'/uploads/news/full/'.$data->image.'" />';
07 $this->metaAttributes[] = '<meta property="og:title" content="'.$this->pageTitle.'" />';
08 $this->metaAttributes[] = '<meta property="og:site_name" content="val.ua" />';
09 $this->metaAttributes[] = '<meta property="og:url" content="http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'" />';
10 $this->metaAttributes[] = '<meta property="og:description" content="'.$this->pageDescription.'" />';
11 $this->metaAttributes[] = '<meta name="twitter:image" content="https://val.ua'.Yii::app()->baseUrl.'/uploads/news/full/'.$data->image.'" />';
12 $this->metaAttributes[] = '<meta name="twitter:image:alt" content="'.$this->pageTitle.'" />';
13 $this->metaAttributes[] = '<meta name="twitter:title" content="'.$this->pageTitle.'" />';
14 $this->metaAttributes[] = '<meta name="twitter:description" content="'.$this->pageDescription.'" />';
15 $this->metaAttributes[] = '<meta name="keywords" content="'.$data->tags.'"/>';

Stack Trace

#4
+
 /var/www/vhosts/val.ua/protected/controllers/SiteController.php(171): CController->render("single", array("data" => null, "allNewsLine" => array(News, News, News, News, ...)))
166                 'params'=>array(':now'=>date("Y-m-d H:i:s",time()+3600), ':marker' => 1)
167             ));
168 
169             $data = News::model()->findByPk($id);
170 
171             $this->render('single', array('data'=> $data, 'allNewsLine'=>$allNews));
172 
173     }
174 
175     public function actionApp(){
176 
#14
+
 /var/www/vhosts/val.ua/index.php(14): CApplication->run()
09 defined('YII_ENABLE_EXCEPTION_HANDLER') or define('YII_ENABLE_EXCEPTION_HANDLER',true);
10 
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 require_once($yii);
14 Yii::createWebApplication($config)->run();
2024-03-19 10:32:48 nginx/1.14.0 Yii Framework/1.1.14