validate only one attribute

I have a lot of validation rules in my model, however, I have a case when I do not need any validation except validate one attribute. Can i to this?

Something like:

$valid = $model->save(‘validate only one attribute “attribute” to be a valid double value’);

make scenario for that attribute, then in your controller make




$model->setScenario("validate_one_param");



You can use next construction:


if($model->validate(array('attribute')) { // will validate only one attribute

  $model->save(false); //will save a model without running validation process

}