PHP notice

Trying to get property of non-object

/home/qualityequipment/public_html/protected/controllers/SiteController.php(267)

255         $this->render('categoryview', array(
256             'dataProvider' => $dataProvider,
257             'listcat' => $listcat,
258         ));
259     }
260 
261 
262     public function actionViewproduct($id)
263     {
264 
265         $model = Product::model()->findByPk($id);
266 
267         $category = Category::model()->findByPk($model->product_type);
268 
269         $this->render('product', array(
270             'model' => $model,
271             'category' => $category,
272         ));
273 
274     }
275 
276     public function actionAboutus()
277     {
278 
279         $content = Page::model()->findByAttributes(array('seo_url' => 'about-us'));

Stack Trace

#9
+
 /home/qualityequipment/public_html/index.php(10): CApplication->run()
05 // remove the following lines when in production mode
06 defined('YII_DEBUG') or define('YII_DEBUG',true);
07 // specify how many levels of call stack should be shown in each log message
08 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
09 require_once($yii);
10 Yii::createWebApplication($config)->run();
2024-03-28 14:32:46 Apache Yii Framework/1.1.12