PHP notice

Trying to get property of non-object

/var/www/mabapa.pl/webapp/protected/controllers/SiteController.php(48)

36             
37             $this->setPageTitle($item[0]['name']);
38             Yii::app()->clientScript->registerMetaTag($item[0]['meta_description'], 'Description');
39             Yii::app()->clientScript->registerMetaTag($item[0]['keywords'], 'keywords');
40             
41             $this->render('index', array('item'=>$item));
42     }
43         
44         public function actionShow() {
45             $page = Page::model()->findByAttributes(array('slug'=>$_GET['slug']));
46 
47             
48             if($page->template==2) {
49                 $this->redirect('/');
50             }
51             
52             $this->setPageTitle($page->name);
53             Yii::app()->clientScript->registerMetaTag($page->meta_description, 'Description');
54             Yii::app()->clientScript->registerMetaTag($page->keywords, 'keywords');
55             $model = null;
56             $view = 'show';
57             $childs = array();
58             
59             $next = null;
60             $prev = null;

Stack Trace

#7
+
 /var/www/mabapa.pl/webapp/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-19 06:50:45 Apache/2.4.18 (Ubuntu) Yii Framework/1.1.13