PHP notice

Trying to get property of non-object

/var/www/avant/data/www/avant-apres.ru/protected/controllers/NewsController.php(31)

19         $pages->applyLimit($criteria);
20 
21         $models = News::model()->findAll($criteria);
22         $this->pageTitle = "Новости - ".$this->pageTitle;
23         $this->render('index', array(
24             'models' => $models,
25             'pages' => $pages
26         ));
27     }
28 
29     public function actionView($url) {
30         $model = News::model()->findByAttributes(array('url'=>$url));
31         $this->pageTitle = $model->name." - ".$this->pageTitle;
32         $this->render('view', array(
33             'model' => $model,        
34         ));
35     }
36 }

Stack Trace

#9
+
 /var/www/avant/data/www/avant-apres.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 05:02:26 Apache/2.4.41 (Ubuntu) Yii Framework/1.1.13