Yii2传参加载到对应模型中:
$model->load(Yii::$app->request->post()
此时,需要对没有传递参数的属性设置默认值,则需要在rules中设置
public function rules()
{
return [
[['status'], 'integer'],
[['status'], 'default', 'value' => 1], //设置默认值
[['updated_time', 'created_time'], 'safe'],
[['name'], 'string', 'max' => 20],
];
}