Created
July 29, 2022 03:34
-
-
Save Octagon-simon/5f58e122fd6adffef040be792a2426fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //custom rules | |
| $customRules = array( | |
| "UNAME" => ['/simon/', "You must enter simon"], | |
| "PASS" => ['/12345/', "You must enter 12345"] | |
| ); | |
| //build the rules | |
| $DemoForm->moreCustomRules($customRules); | |
| //redefine validation rules | |
| $valRules = array( | |
| "username" => array( | |
| ["R", "Your username is required"], | |
| ["UNAME"] | |
| ), | |
| "email" => array( | |
| ["R", "Your Email is required"], | |
| ["EMAIL", "Your Email is invalid"] | |
| ), | |
| "age" => array( | |
| ["R", "Your Age is required"], | |
| ["DIGITS", "Your Age must be in digits"] | |
| ), | |
| "password" => array( | |
| ["R", "Your Password is required"], | |
| ["PASS"] | |
| ) | |
| ); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment