0

i have generated a model by gii for my table which by default generated required rule for some database field in rules section. But i don't want some of the fields of them to be required so i simply removed them from required portion. but this is not working. what i have by default is this

[['grp_name', 'sub_grp', 'member_name',  'fathers_name', 'd_o_b', 'occupation', , 'address', 'phone_no', 'nomniee_one',  'per_allotment_one',  'per_allotment_two' ], 'required'],

but i don't want to make 'per_allotment_two' required so iremoved it and made this

  [['grp_name', 'sub_grp', 'member_name',  'fathers_name', 'd_o_b', 'occupation', , 'address', 'phone_no', 'nomniee_one',  'per_allotment_one' ], 'required'],

but got this error enter image description here

enter image description here enter image description here

rahul s negi
  • 139
  • 14

1 Answers1

0

If the per_allotment_two is not required means in the database make the per_allotment_two has default null.Otherwise provide some default value to it. Then remove the per_allotment_two from the model in the rules section.It will work.