PHP notice

Trying to get property of non-object

/var/www/ideyaplus-nsk.ru/data/www/ideyaplus-nsk.ru/protected/views/site/newsList.php(2)

01 <?php
02 $this->pageTitle = $model->title;
03 $this->breadcrumbs = array($model->title);
04 ?>
05 <?php foreach ($news as $news) : ?>
06     <div class="news">
07         <span class="data"><?= $news->when_add ?></span>
08         <h3><?= $news->title ?></h3>
09         <div><?= $news->content ?></div>
10         <a href="<?= $this->createUrl("/news/{$news->url}") ?>" class="more">подробности</a>
11     </div>
12 <?php endforeach; ?>

Stack Trace

#4
+
 /var/www/ideyaplus-nsk.ru/data/www/ideyaplus-nsk.ru/protected/controllers/SiteController.php(41): CController->render("newsList", array("news" => array(News), "model" => null))
36         $c->select = 'title, content, url, when_add AS wa, DATE_FORMAT(when_add, "%d.%m.%Y") AS `when_add`';
37         $c->order = 'wa DESC';
38         $this->render('newsList', array(
39             'news' => News::model()->findAll($c),
40             'model' => Pages::model()->findByUrl('news')
41         ));
42     }
43 
44     public function actionNews()
45     {
46         if (empty($_GET['view'])) $this->actionNewsList();
#12
+
 /var/www/ideyaplus-nsk.ru/data/www/ideyaplus-nsk.ru/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-29 18:25:17 Apache/2.4.10 (Debian) Yii Framework/1.1.12