Difference between #7 and #8 of
Reference: Model rules validation

Revision #8 has been created by GoorooTech on Nov 21, 2010, 3:23:06 AM with the memo:

Added time rule example (CTypeValidator)
« previous (#7) next (#9) »

Changes

Title unchanged

Reference: Model rules validation

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

Form validation

Content changed

[...]
2. `dateFormat`, the format pattern that the date value should follow.
3. `datetimeFormat`, the format pattern that the datetime value should follow.
4. `timeFormat`, the format pattern that the time value should follow.
5. `type`, the data type that the attribute should be.


 
Example of time rule;
 
 
```php 
array('org_starttime, org_finishtime', 'type', 'type'=>'time', 'timeFormat'=>'hh:mm'),
 
```
 
 
 
 
+ `unique` : [CUniqueValidator], validates that the attribute value is unique in the corresponding database table.
1. `allowEmpty`, whether the attribute value can be null or empty.
2. `attributeName`, the ActiveRecord class attribute name that should be used to look for the attribute value being validated.
3. `caseSensitive`, whether the comparison is case sensitive.
4. `className`, the ActiveRecord class name that should be used to look for the attribute value being validated.
5. `criteria`, additional query criteria.
[...]
97 0
117 followers
Viewed: 767 344 times
Version: 1.1
Category: How-tos
Written by: krillzip
Last updated by: Rodrigo
Created on: Nov 29, 2009
Last updated: 4 years ago
Update Article

Revisions

View all history