Difference between #25 and #26 of
Reference: Model rules validation

Revision #26 has been created by CedSha on Feb 19, 2013, 6:29:17 AM with the memo:

Add another sample for filter method
« previous (#25) next (#27) »

Changes

Title unchanged

Reference: Model rules validation

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

Form validation, model, validation, reference, validation rules, validator

Content changed

[...]
### `filter` : [CFilterValidator]
Transforms the data being validated based on a filter.

1. **filter**, the filter method.

*Example
s:* - With standard function
 
 
```php 
array('mycode','filter','filter'=>'strtoupper'),
 
```
 
With custom function

```php
array('eanupc','filter','filter'=>array($this,'keepProductCode')),
...
public function keepProductCode($eanupc){
[...]
99 0
114 followers
Viewed: 891 715 times
Version: 1.1
Category: How-tos
Written by: krillzip
Last updated by: Rodrigo
Created on: Nov 29, 2009
Last updated: 11 years ago
Update Article

Revisions

View all history