Download the PHP package fuelphp/validation without Composer

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

FuelPHP Validation library.

Build Status Code Coverage Code Quality HHVM Status

A flexible library to validate different kinds of data.

Simple usage

Current validation rules

All core rule classes can be found under the Fuel\Validation\Rule namespace.

Error messages

Messages can be retrieved from the result object after validatoin has been performed

Custom messages

Messages can be set in two ways, directly on a rule instance or as part of the method chain.

Now when the required() rule fails the custom message will be used.

There are several tokens that can be used as substitutions for various values. As in the example {label} will be replaced with the field's label and {name} will be replaced with the field's name. (name in the example above). Rules can also provide other values, for instance NumericBetween will allow you to use {upperBound} and {lowerBound}. Please refer to each rule on the custom tokens provided.

If a token in a string is not found then it will simply be ignored and not replaced.

Default messages

It is possible to change the default message for a given rule by calling setGlobalMessage() on the Validator object. After this method is called any rules created through the Validatator via either magic methods or createRuleInstance() will have the specified message set by default.

Manually adding rules and rule overriding

As well as using the default core rules it is possible to dynamically add your own rules or override existing rules.

This is done by calling the addCustomRule() function on a Validator like so: $v->addCustomRule('myCustomRule', 'My\App\Rules\CustomRule'). If the class cannot be loaded for any reason an InvalidRuleException will be thrown when the rule gets used.

The myCustomRule rule is now available for use with the Validator instance and can be called via the magic method syntax as well as the createRuleInstance() function in Validator.

Overriding existing rules

It is possible to replace existing rules simply by calling addCustomRule() as in the previous example and passing the name of an existing rule

Nested validators

It is possible to use a validator itself as a rule for an entry in the data being validated. This allows child models to be validated along with the parent data. This can be done using the Fuel\Validation\Rule\Validator rule and can be nested as deeply as you desire.

Automatic Validator population

Through the use of RuleProvider classes it is possible to automatically create rule sets for a given Validator this can be used to automatically create validation for any kind of object from forms to ORM models. At the moment only one provider exists to serve as an example that creates rule sets from a config array. In the future Fieldset and ORM will provide their own providers.

The provider is used by creating a new Validator, setting up your config array and then populating the Validator.

The RuleProviders will also be aware of custom rules that are added to the Validator that they are passed.

You can also add a config with your custom structure.


All versions of validation with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
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 fuelphp/validation contains the following files

Loading the files please wait ....