Yii 2 对象错误

阮金中

图 1

图像 2

请帮助我,我是基本的 Yii 2. 当我尝试提供产品信息时,我得到“试图获取非对象的属性”。非常感谢你

⒈胺

$product为空,您需要检查 $product 中是否为空actionView

public function actionView($id){
//Your Query
if(!$product)
  throw new NotFoundHttpException('The Post is not exist.');
// $this-render … 
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章