Download the PHP package jakesutherland/nomad-validate without Composer

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

Nomad Validate

A WordPress PHP Composer Package that provides you with an easy way to validate data against a set of rules and generate error messages.

Installation

You can install Nomad Validate in your project by using composer.

Dependencies

Nomad Validate depends on Nomad Helpers for various functions and utilities and needs to be installed in order to run.

If for some reason you didn't install Nomad Validate via Composer as a required package in your project, you will still need to run composer install to install it's dependencies as they are not included in the repository.

Documentation

Nomad Validate has one simple function that you can use to validate data against a set of rules.

Example Usage

Each data item must have each of the following arguments: key, label, value, and rules.

You can optionally overwrite rule error messages through the error_messages argument and specify the rule key and your custom message. You can see this in the terms example below.

Available Rules

Each rule is added to the rules argument individually for each piece of data.

Some rules contain arguments which let you further customize how the data is being compared and validated. To pass in an argument add a colon : after your rule key and then provide your argument value (<rule>:<argument>). You can see examples of rules with arguments below.

boolean

Usage: boolean, boolean:strict, boolean:truthy, boolean:falsey

Description: Checks that the value is a boolean value (true or false). You can also have it check for "truthy" (true, 1, 'true', '1', 'yes', 'on', 'truthy') or "falsey" (false, 0, 'false', '0', 'no', 'off', 'falsey') values.

choices

Usage: choices:value1,value2,value3

Description: Checks that the value is one of the provided choices. Each choice is separated by a comma.

date

Usage: date:Y-m-d

Description: Checks that the value is a date in the specified format. See https://www.php.net/manual/en/datetime.format.php for DateTime format options.

email

Usage: email

Description: Checks that the value is a valid email address.

equals

Usage: equals:value

Description: Checks that the value equals the provided value.

letters

Usage: letters

Description: Checks that the value only contains letters.

matches

Usage: matches:my_field_key

Description: Checks that the value matches the value of the specified key.

maxlength

Usage: maxlength:20

Description: Checks that the value character length is less than or equal to the provided number.

max

Usage: max:2021

Description: Checks that the value is less than or equal to the provided number.

minlength

Usage: minlength:10

Description: Checks that the value character length is greater than or equal to the provided number.

min

Usage: min:1900

Description: Checks that the value is greater than or equal to the provided number.

numbers

Usage: numbers

Description: Checks that the value only contains numbers.

numeric

Usage: numeric

Description: Checks that the value is numeric.

regex

Usage: regex:/^([A-Za-z0-9_\-\.]*)$/

Description: Checks that the value matches the given regular expression.

required

Usage: required

Description: Checks that the value is not empty.

trim

Usage: trim

Description: This is a special rule and simply trims whitespace from the left and right of the value.

url

Usage: url

Description: Checks that the value is a valid URL.

Available Hooks

nomad/validate/{$key}

nomad/validate/{$key}/{$rule_key}/error_message

nomad/validate/error_messages

Changelog

v1.1.0

v1.0.0

License

The MIT License (MIT). Please see License File for more information.

Copyright

Copyright (c) 2021 Jake Sutherland


All versions of nomad-validate with dependencies

PHP Build Version
Package Version
Requires jakesutherland/nomad-helpers Version ^1.2.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 jakesutherland/nomad-validate contains the following files

Loading the files please wait ....