I have an active form model which has fields I do not wish to set any validation rules for. The problem is that Yii does not set these fields when I submit the form unless I assign some validation rule to them.
The fields are optional and free-form, so I don’t want to assign a validation rule. Any suggestions?
Use the special “safe” rule:
This rule does not place any restrictions on the field (so you are free to leave it empty); it just tells Yii that you want the field to be set on the model whenever the model is populated from an external source.