PHP notice

Trying to get property of non-object

/home/qualityequipment/public_html/protected/controllers/ProductController.php(52)

40                 'users' => array('*'),
41             ),
42         );
43     }
44 
45     /**
46      * Displays a particular model.
47      * @param integer $id the ID of the model to be displayed
48      */
49     public function actionView($seo_url)
50     {
51         $model = Product::model()->findByAttributes(['seo_url' => $seo_url]);
52         $category = Category::model()->findByPk($model->product_type);
53 
54         $gallery = Gallery::model()->with('galleryImages')->findByPk(5);
55 
56 
57         $this->setPageTitle($model->browser_title);
58 
59         $this->render('single_item', array(
60             'model' => $model,
61             'category' => $category,
62             'gallery' => $gallery,
63         ));
64     }

Stack Trace

#14
+
 /home/qualityequipment/public_html/index.php(10): CApplication->run()
05 // remove the following lines when in production mode
06 defined('YII_DEBUG') or define('YII_DEBUG',true);
07 // specify how many levels of call stack should be shown in each log message
08 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
09 require_once($yii);
10 Yii::createWebApplication($config)->run();
2024-03-28 11:59:48 Apache Yii Framework/1.1.12