PHP notice

Trying to get property of non-object

/home2/ieccom/public_html/protected/controllers/CategoriesController.php(431)

419     
420 
421  
422     public function actionProducts($id)
423     {
424         Yii::app()->theme = 'iec';
425         $this->layout = '//layouts/column2';
426         $model = $this->loadModel($id); 
427         $brand = $model->brand_id;
428 
429         $productsmodel = Products::model()->loadCategoryProducts($id);
430         $brandModel = Brands::model()->findByPk($brand);
431         if($brandModel->themes!= '' && $brandModel->themes != Yii::app()->theme)
432         {
433             Yii::app()->theme=$brandModel->themes;
434         }
435 
436         //for breadcrumb fetching respective path for the table attributes
437         $pRecords= Categories::model()->getSubPath($id);
438 
439         $this->render('_listproducts', array('model'=>$model, 'products'=>$productsmodel, 'pRecords'=>$pRecords));   
440     }
441 
442 
443  

Stack Trace

#14
+
 /home2/ieccom/public_html/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-28 18:50:20 Apache Yii Framework/1.1.10