[Solved] Active record validation

in database one row i want to save for example file name “foto.jpg” “file.pdf”, 'file.doc" and etc.

in some cases i need to validate this value like Type = photo, in other cases like Type = file. i have only one column saving for this values.

example of my table.

| Type | Value |

| File | file.pdf |

| Photo | foto.jpg |

how i need to validate my active record class for specific type of field?

There is a CFileValidator, if it doesen’t suite for you you can write your own validation function (simply a function in the model class, that you are refering as the validator name).

thank you for you help it helped to me :)