PHP notice

Trying to get property 'category' of non-object

/home/hpmn/domains/hoaphatmiennam.com/public_html/protected/controllers/ProductsController.php(24)

12     
13     public function actionSearch($keyword) {   
14         $this->pageTitle = 'Tìm kiếm - ' . Yii::app()->setting->getItem('defaultPageTitle');
15         $model = Products::searchFe($keyword);
16         $this->render('search', array(
17             'model' => $model
18         ));
19     }
20     
21     public function actionCategory($slug) {
22         try{
23             $cat = ProductCategories::model()->getCatBySlug($slug);            
24             $this->pageTitle = $cat->category . ' - ' . Yii::app()->setting->getItem('defaultPageTitle');
25             $this->render('category', array(
26                 'cat' => $cat
27             ));
28         } catch (Exception $e) {
29             throw new CHttpException(404, 'The requested page does not exist.');
30         }
31         
32     }
33     
34     public function actionDetail($slug) {
35         $product = new Products();
36         $model = $product->getDetailBySlug($slug);        

Stack Trace

#14
+
 /home/hpmn/domains/hoaphatmiennam.com/public_html/index.php(30): CApplication->run()
25 // remove the following lines when in production mode
26 
27 require_once($yii);
28 Yii::createWebApplication($config);
29 SettingForm::applySettings();//override settings by values from database
30 Yii::app()->run();
2024-03-19 14:40:10 Apache Yii Framework/1.1.14