I'm needing to change some of the rules used for form validation in the Gallery3 module "register". However, I have no idea what validation system it's using or what I can do to modify it. Can anyone tell me where I can find documentation for this?
Here's an example:
$group->input("email")->label(t("Email"))->id("g-email")
->rules("required|valid_email|length[1,255]");
Seems Gallery3 is built on Kohana 2.3, and hitting their ORM docs reveals a section about validation:
http://kohanaframework.org/3.2/guide/orm/validation
This seems like a good place to start. The actual API for the Validation class can be found here:
http://kohanaframework.org/3.2/guide/api/Validation
Digging a little deeper, the non-standard rules seem to be defined in each model in Gallery3:
https://github.com/gallery/gallery3/blob/master/modules/user/models/user.php
In the above model (extending ORM) there is a $rules property, and methods matching them prefixed with 'valid_' (eg. 'email' in the $rules property maps to the valid_email method)