想创建新的用户无数据保存,当我创建新的用户
我修改这个代码
public function actionCreate() {
$model = new Users;
if(isset($_POST['Users'])) {
if($model->load(Yii::$app->request->post())) {
if($model->save()){
return $this->redirect(['']);
}
}
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
,但它不保存! 怎么能找到问题?
调试你的代码,并显示方法$ model-> load() – Alex