Download the PHP package phpixie/validate without Composer

On this page you can find all versions of the php package phpixie/validate. 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 validate

Validate

PHPixie Validation library

Most PHP validation libraries share a large flaw - they only work with flat arrays and are mostly targeting form validation. This approach is irredeemably outdated, as when developing APIs and RESTful services we frequently have to work with request documents with complex structures. PHPixie Validate is designed to provide an easy approach to validating those. It requires no dependencies, so even if you are not using PHPixie it can still come in handy in your project.

Let's start with an easy flat array example first:

The full list of available filters can be found here. Every public method in these Registry classes is an available filter

You can also build the validator using an shorthand callback syntax:

Now let's try validating:

Working with results

As you can see above a Result object contains the errors appended to it and also results of all fields. It may see that errors are just strings, while in fact they are also classes that implement the magic __toString() method for debugging convenience. When working with forms you'll probably want to use your own error messages instead. To do this get the type and parameters information from the error class and format it accordingly, e.g. :

This way with a simple helper class you can customize all errors for your users.

Data structures

Now let's try a structured example:

It looks much better with the alternative syntax, since it follows the structure of your data:

Now let's try using it:

Try it out

To fire up this demo, just run:


All versions of validate with dependencies

PHP Build Version
Package Version
No informations.
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 phpixie/validate contains the following files

Loading the files please wait ....