how to use PHP's native filter_input_array with Yii?

I want to use filter functions provided by PHP natively, such as filter_input_array, filter_input, or filter_var_array. what is your recommendation on this? like where should I declare these filters?

It will be very nice if I can somehow integrate this with rules() in Yii model since they are similar in context.

you can create a custom validation method…

read carefully the documentation for the validation rules - http://www.yiiframework.com/doc/guide/1.1/en/form.model#declaring-validation-rules

oh, I know how to write a custom validation method, but it takes only one parameter which is a value to one attribute while filter_var_array takes an array of attributes?

I’m not asking you to write me a piece of code, but I am asking if it is possible to integrate filter_var_array or filter_input_array with Yii?

You asked for filter_input() too… this can be used for one parameter…

For filter_input_array()… how would you know what parameters you need to test, as some could still be empty (if ajax validation is used)?

Anyway you can use $this->parameter1, $this->parameter2 in the custom validation method…

Empty parameters could be just ignored, since they are set as NULL, as opposed to FALSE, when using filter_input_array. Thank you very much. That was exactly what I needed.