Creating Custom Validators

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.

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


Leave a Reply

Your email address will not be published. Required fields are marked *