One of the most frustrating developer tasks is to do the same thing all day over again. For example write validators in front- and backend. Here come good news. With GDOv7 you rarely ever have to write a validator again. Simply because the inheritance is smart, the validation is flexible and with only a few validators most stuff is covered. All GDT know how to validate and the validation is automatically consinstent in js, html and php.
Never write validators again \o/
The only default validation is the null check, implemented in GDT_Field.
GDT_String can validate for lengths, regex patterns and uniqueness.
GDT_Int can validate for min/max values and uniqueness.
GDT_Decimal is inheriting from int, using the same validators.
The unique validators are implemented in GDT_Int and GDT_String. As GDT_Object and GDT_Select inherit from these, all unique validations are covered easily.
Always funny to hazzle how to validate your email today? GDT_Email is a nice example to show the ease of GDOv7. Validation is done client and server side with the same regex pattern, using GDT_String to validate the pattern.
GDT_Url optionally validates existing URLs, supporting a few schemes.
GDT_Path can validate for an existing file (or folder).
GDT_Path also features auto-completion for files on your server.
In some cases you really have to write a validator. If things get complex, your best friend is GDT_Validator. It needs a GDT that it shall validate and a validator callback. Simply call error() on the GDT to check, and you are covered.