The file field rule

The on property isn’t available in the rules

array(‘avatar’, ‘file’, ‘types’=>‘jpg, jpeg, gif, png’, ‘on’ => ‘register’),

How to specify the "on property" for the file field.

The scenario ‘on’ property is available for this validator, I use it myself. All validators allow a scenario. It’s listed right here in the api.

This is one of the rules I use:


array('image', 'file', 'allowEmpty' => true, 'types' => 'jpg, jpeg, gif, png', 'on' => 'formSubmit'),