PHP notice

Trying to get property of non-object

/var/www/www-root/data/www/sk-spartak.ru/protected/controllers/frontend/PostsController.php(313)

301             $criteria->params = array('status' => 1);
302             $criteria->order = "g_date desc";
303             $newsList = News::model()->findAll($criteria);
304 
305             $this->pageTitle = $metaArr->title_name . ' - ' . Yii::app()->name;
306             $this->description = $metaArr->description;
307             $this->keywords = $metaArr->keywords;
308             $this->render('newsList', array("newsList" => $newsList));
309         }
310         if ($id_new != "") {
311 
312             $news = News::model()->findByPk($id_new);
313             if ($news->title!=""){
314                 $this->pageTitle = $news->title . ' - ' . $metaArr->title_name . ' - ' . Yii::app()->name;
315             }else{
316                 $this->pageTitle = $news->name . ' - ' . $metaArr->title_name . ' - ' . Yii::app()->name;
317             }
318 
319             $this->render('newsElem', array("news" => $news));
320         }
321 
322     }
323 
324     public function actionCatalog()
325     {

Stack Trace

#7
+
 /var/www/www-root/data/www/sk-spartak.ru/protected/behaviors/WebApplicationEndBehavior.php(22): CApplication->run()
17         $this->_endName = $name;
18         
19         // обрабатываем событие создания модуля
20         $this->onModuleCreate = array($this, 'changeModulePaths');
21         $this->onModuleCreate(new CEvent ($this->owner));
22         $this->owner->run();        
23     }
24     
25     // обработчик события onModuleCreate
26     public function onModuleCreate($event)
27     {
#9
+
 /var/www/www-root/data/www/sk-spartak.ru/index.php(12): CComponent->__call("runEnd", array("frontend"))
07 defined('YII_DEBUG') or define('YII_DEBUG', true);
08 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
09 // подключаем фреймворк
10 require_once($yii);
11 // стартуем приложение с помощью нашего WebApplicaitonEndBehavior, указав ему, что нужно загрузить фронтенд
12 Yii::createWebApplication($config)->runEnd('frontend');
2024-03-28 12:07:31 Apache/2.4.18 (Ubuntu) Yii Framework/1.1.14