PHP notice

Trying to get property of non-object

/home/binhminh/domains/nuocnongbinhminh.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 = Menus::model()->getCatBySlug($slug);
24             $find_l2 = Menus::findProductMenu($cat->id);
25             $arr_id = array($cat->id);
26             if (!empty($find_l2)) {
27                 foreach ($find_l2 as $item1) {
28                     $arr_id[] = $item1->id;
29                     $find_l3 = Menus::findProductMenu($item1->id);
30                     if (!empty($find_l3)) {
31                         foreach ($find_l3 as $item2) {
32                             $arr_id[] = $item2->id;
33                         }
34                     }
35                 }
36             }

Stack Trace

#14
+
 /home/binhminh/domains/nuocnongbinhminh.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-28 21:53:58 Apache/2 Yii Framework/1.1.14