PHP warning

Creating default object from empty value

/home/sltechcom/public_html/protected/controllers/ProductController.php(154)

142             }
143             Yii::app()->user->setState('keyword', $keyword);
144             $this->redirect(array('product/index'));
145         }
146     }
147 
148     public function actionDetails($id = NULL) {
149         if (Yii::app()->user->isAdmin()) {
150             $this->redirect(array($this->_dashboard));
151         } else {
152             $model = $this->loadProduct($id);
153             $noOfView = $model->no_of_view;
154             $model->no_of_view = $noOfView + 1;
155             try {
156                 $model->save(false);
157             } catch (Exception $e) {
158                 
159             }
160             if (!$model) {
161                 Yii::app()->user->setFlash('info', 'Product doesn\'t exists.');
162                 $this->redirect(array('product/index'));
163             } else {
164                 $this->render('details', array('model' => $model));
165             }
166         }

Stack Trace

#9
+
 /home/sltechcom/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 19:51:43 Apache Yii Framework/1.1.14