应该就是利用 scenario 来实现,只有在当前 scenario 下的attribute才能被块赋值,所以假定现在Model的是 blabla 那么在 $model->load 或者 使用 $model->setAttributes 进行赋值的时候,只有当前 secnario` 下的属性「safe attribute」被赋值
应该就是利用
scenario
来实现,只有在当前scenario
下的attribute才能被块赋值,所以假定现在Model的是
blabla那么在
$model->load或者 使用
$model->setAttributes进行赋值的时候,只有当前
secnario` 下的属性「safe attribute」被赋值