PHP notice

Trying to get property of non-object

/home/qualityequipment/public_html/protected/controllers/ProductController.php(294)

282             'gallery' => $gallery,
283         ]);
284 
285     }
286 
287     /**
288      * Export product PDF specification
289      * @param $id
290      */
291     public function actionExportPdf($id)
292     {
293         $data = Product::model()->findByPk($id);
294         $file = "Product $data->browser_title";
295 
296         $filename = $file . "_" . date("Y-m-d") . '.pdf';
297 
298         $this->renderPdf('productpdf', $filename, ['data' => $data]);
299     }
300 }

Stack Trace

#14
+
 /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 15:32:40 Apache Yii Framework/1.1.12