0
我尽力解决这个问题,但我似乎无法弄清楚问题所在。这里是我的代码:Yii2-未定义的变量:模型
在动作控制器
return $this->render('viewcreated', [
'dataProvider' => $dataProvider,
'model' => $this->findModel($id),
'id' => $model->id
/*'searchModel' => $searchModel*/
]);
查看
$this->title = $model->id; // here it gives the error
我怎样才能解决这个问题?
任何帮助将高度赞赏
删除线“身份证” => $模型 - > ID在控制器 –
你确定你收到此错误通过VAR
$model
直接访问在视图文件? –