maxiannicu
(Maxiannicu)
1
I’m in trubble with model rules.
In my rules :
array('photoMain, photoFirst , photoSecond', 'file', 'types'=>'jpg, gif, png')
after triyng to validate , i got an error :
Why is this required ? i haven’t made these field “required” in my rules!!!
re1nald0
(Reinld17)
2
Maybe add:
array('photoMain, photoFirst , photoSecond', 'file', 'allowEmpty'=>true, 'types'=>'jpg, gif, png')
The default value of ‘allowEmpty’ is false, which means it is required.
alirz23
(Ali Raza)
3
IMO thats is good thing you should only try upload or run second validation if there is a file available
maxiannicu
(Maxiannicu)
4
thank you , it worked ! i supposed that there would be required if only will be required validator ! A lot of thanks !