PHP warning

Attempt to read property "id" on null

/home1/sglegyp/public_html/protected/controllers/HomeController.php(97)

085                                 'allcategory'=>$allcategory ,
086                                 
087                                 ));
088 }
089 
090 
091 
092 
093 public function actionSubcategory($slug)
094     {
095         $details = Category::model()->findByAttributes(array('slug'=>$slug));
096         
097         $allsubcategory = Category::model()->findAll(array('condition' => 'parent_id=' . $details->id ,'order'=>'intro ASC'    ));
098         $allcategory = Category::model()->findAll(array('condition' => 'parent_id=' . 1 ,'order'=>'intro ASC'   ));
099               
100         
101         
102         $this->render('subcategory',array(
103                                 'allsubcategory'=>$allsubcategory ,
104                                 'allcategory'=>$allcategory ,
105 'allpromodel '=>$allpromodel  ,
106                                 'details'=>$details
107                                 
108                                 ));
109 }

Stack Trace

#14
+
 /home1/sglegyp/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 14:11:31 Apache Yii Framework/1.1.14