This is a validation that depending on the attribute value can apply other validators (not necessary on the same attribute).
tested with Yii 1.1.12 but should work with all Yii 1.1.*
The validator contains 2 attributes, one for the choices (cases) that the attribute can have and one when the validators that will be applied when none of the cases were matched ( default keyword when using a switch )
So imagine that you want to do a validation like this. You have an attribute type that is the type of the file to upload, and depending the type you want to apply certain validations to the file field (or different like the case). Given this stage you should put something like this in your rules function.
//... more rules validators here array('type', 'ext.validators.FSwitchValidator', 'cases'=>array( 'image'=>array( array('file', 'required') array('file', 'file', 'types'=>'jpg,png') ), 'video'=>array( array('url', 'required'), array('url', 'validVideoUrl'), ) ), 'default'=>array('url', 'url', 'defaultSchema'=>'http') //simple array if only one validator ), //... more rules validators here