im creating a form for user management in admincp and i want it to include an image uploader for user avatars (in the user edit form)...
and want to declare its rules ... like being in a jpg or jpeg format
but it forces the attribute to be required! which i dont want to!
i want it to validate only if a file is uploaded and its in one of types of jpg gif png...
and if the file is not sent ... just leave it and validate another form data
here is my rules function:
public function rules() {
return array(
array('avatarpic', 'file', 'types'=>'jpg, gif, png'),
);
}
is there any validation alias like not_required?