Creating Custom Validators

intro
Let’s create simple url validator. You can download the source code of this article from here.

1.Create Validate Class
Create the file library/My/Validate/SimpleUrl.php with the following content.
2.Add Validator
Add the simple url validator to form object like the following.

You can add your validators to element objects like the following.

3.Check
Let’s access your web server and check the url validation.

3 Comments

Leave a Reply

Your email address will not be published.