In Yii1.1 I was using the following validation rule for optional fields.
"length","allowEmpty"=>true
Can anybody tell me the equivalent code for Yii 2 ?
===========
Found the solution:
[[‘attribute’],‘default’,‘value’=>’’],
In Yii1.1 I was using the following validation rule for optional fields.
"length","allowEmpty"=>true
Can anybody tell me the equivalent code for Yii 2 ?
===========
Found the solution:
[[‘attribute’],‘default’,‘value’=>’’],
‘skipOnEmpty’=>true
SkipOnEmpty Docs