The below model extends CFormModel and I need to mention rules to it such that the attributes allow only integers.
class SearchForm extends CFormModel {
public $min_size;
public $max_size;
/**
* Declares the validation rules.
* The rules state that username and password are required,
* and password needs to be authenticated.
*/
public function rules() {
array('min_size, max_size', 'numerical', 'integerOnly'=>true),
);
}
But, the above validation is not working. How can I validate the text field to allow integers only