我试图从标题中获取价值,我做到了,但是在按下保存按钮后,标题没有保存在数据库中
$model = new Translation();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
$getfromtitle = Yii::$app->request->post('Translation')['translation_title'];
echo $getfromtitle;
echo "<br />";
$model->translation_drive_title = $getfromtitle;
echo $model->translation_drive_title;
echo "<br />";
echo "here";
die();
}
杀死代码后,是的,一切都按我的意愿打印,但是在按下保存/提交按钮后(当然删除 die() 函数让代码继续),我从第一个输入获得的标题没有保存到第二个输入数据库中的 $model->translation_drive_title
谢谢你们