Download the PHP package voku/html-form-validator without Composer

On this page you can find all versions of the php package voku/html-form-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package html-form-validator

Build Status Coverage Status Codacy Badge Latest Stable Version Total Downloads License Donate to this project using Paypal Donate to this project using Patreon

:flashlight: HTMLFormValidation

Description

HtmlFormValidator is a very easy to use PHP library that will help you to validate your data and you can use this independent from your framework of choice.

Install via "composer require"

How does this work?

  1. First you need to generate a html form, that's completely your part. You can write it manually or you can generate with a framework or a library, it doesn't matter.

  2. Then we use DOM Parsing via voku/simple_html_dom, to detect the current validator and filter rules directly from the html.

  3. And finally, we use Respect/Validation to validate the form.

Simple Example

Extended Example

Validator

You can use all validators from here.

e.g.: || (you need to lowercase the first letter from the class or you can use the class name itself)

You can combine validators simply via "|" ...

e.g.:

PS: you can add arguments comma separated or you can use serialize -> something like that ->

If you want to use the HTML5 validation e.g. for min or max values, or for e.g. email then you can use "auto".

e.g.:

By default we limit the submitted values to the values from the form e.g. for checkboxes, radios or select boxes. If you need to disable this, you can use "non-strict". (not recommended)

e.g.:

By default we use the error messages from the validation exception class, but you can use your own error messages via: "data-error-message--RULE_NAME_HERE" in the html.

e.g.:

By default we don't add error messages into html output, but you can add the error messages with a css selector:

e.g.:

By default we also don't add error classes, but you can add a new error class via:

e.g.

And if you need a more complex validation, then you can add simple-custom validations.

e.g.:

And if you need really complex validation, then you can create your own classes.

e.g.:

Filter

You can also use some simple filters, that will be applied on the input-data.

e.g.:

PS: the first argument will be the submitted value from the user

And also here you can combine some filters simply via "|" ...

e.g.:

... and you can also add custom filters by your own.

e.g.:

Unit Test

1) Composer is a prerequisite for running the tests.

2) The tests can be executed by running this command from the root directory:

Support

For support and donations please visit Github | Issues | PayPal | Patreon.

For status updates and release announcements please visit Releases | Twitter | Patreon.

For professional support please contact me.

Thanks


All versions of html-form-validator with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
respect/validation Version ~2.2
voku/email-check Version ~3.1
voku/simple_html_dom Version ~4.7
voku/portable-utf8 Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package voku/html-form-validator contains the following files

Loading the files please wait ....