PHP Error

Trying to get property of non-object

/home/trungdq/domains/trungdiep.com/public_html/protected/controllers/SiteController.php(492)

480         'cat' => $cat,
481         ));
482     }
483 
484     /*
485     * LIỆT KÊ SẢN PHẨM THEO CHỦNG LOẠI
486     */
487     public function actionListProductByType($id, $name)
488     {
489         $arr_type = array();
490         $conf = Configure::getConfigure();
491         $type = Type::model()->findByPk($id);
492         $arr_type[] = $type->id;
493         $this->cat_id = $type->cat_id;
494 
495         //navigation_bar
496         if (!empty($type->cat)) {
497             $cat = $type->cat;
498             $this->navigation_bar = $this->navigation_bar . '<i class="fa fa-angle-double-right"></i>' . CHtml::link($cat->name, Yii::app()->urlManager->createUrl('site/ListProduct', array('id' => $cat->id, 'name' => $cat->url)));
499         }
500         if (!empty($type->type)) {
501             $pare = $type->type;
502             $this->navigation_bar = $this->navigation_bar . '<i class="fa fa-angle-double-right"></i>' . CHtml::link($pare->name, Yii::app()->urlManager->createUrl('site/ListProductByType', array('id' => $pare->id, 'name' => $pare->url)));
503         }
504         $this->navigation_bar = $this->navigation_bar . '<i class="fa fa-angle-double-right"></i>' . CHtml::link($type->name, Yii::app()->urlManager->createUrl('site/ListProductByType', array('id' => $type->id, 'name' => $type->url)));

Stack Trace

#9
+
 /home/trungdq/domains/trungdiep.com/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-19 15:45:47 Apache/2 Yii Framework/1.1.7