yiisoft/yii — pull request #1747 by resurtm (2012-11-23 15:41:43+00:00)
Title: CUniqueValidator and CExistValidator now able to cache validation data through their new $finder property

Usage:

```php
!CCaptcha::checkRequirements()),
array('itemId','required'),
array('itemId','exist',
'finder'=>Item::model()->cache(3600,new CDbCacheDependency('SELECT MAX(updated_at) FROM {{item}}')),
'attributeName'=>'id'),
);
}
}
```

```php
cache(3600,new CDbCacheDependency('SELECT MAX(updated_at) FROM {{item}}'))
->findAll(array('select'=>array('id','title')));
$this->render('contact',array('model'=>$model,'items'=>$items));
}
```

```php

labelEx($model,'itemId'); ?>
dropDownList($model,'itemId',CHtml::listData($items,'id','title'),array('empty'=>'(select item)')); ?>
error($model,'itemId'); ?>

```