Download the PHP package hypnokizer/validator without Composer

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

Validator Class

This is a simple validator class. It can be used without dependancies, but extends the database class. It is based on https://github.com/devwithkunal/php-validator-class.

Basic Use

Create the class instance. The constructor parameter is an associative data array to be validated containing key value pairs of field names and values. If the $data is not specified, the class attempts to pull in POST data, then GET data.

Run validation checks by chaining methods to the field() method. The field() method must start every method chain.

Check if the data is valid using the isValid() method.

Basic Methods

To start validation of a field, use the field() method. Once all validations are performed, use the isValid() method to determine if they were successful.

Method Description
field($name, $alias) Set the field name to start validation.
$name - Name of the field/key to validate.
$alias - Alias to use in error messages instead of the field name.
isValid() Check if all validations are successful.

Validation methods available

After the field() method is called for a field, you can chain validation methods for each field.

Method Description
alpha($ignore) Check for alphabetic characters.
alphanumeric($ignore) Check for alphanumeric characters.
changecase($case) Change case of string: capitalize, uppercase, lowercase.
contains($chars) Check if the value contains specific characters.
date() Check for a valid date.
dateafter($date) Check if a date comes after the given date.
datebefore($date) Check if a date comes before the given date.
email() Check for email address.
enum($list) Check if a value is in the list of approved values.
equals($value) Check if value is equal to a given value.
integer() Check for integer.
length($length) Check for exact length of string.
maxlength($length) Check for maximum length of string.
maxvalue($value) Check for maximum value of integer or float.
minlength($length) Check for minimum length of string.
minvalue($value) Check for minimum value of integer or float.
money($ignore) Check for currency. Changes string to decimal by removing dollar signs, commas, decimals, and negative signs.
numeric() Check for numeric characters.
period() Check for a date string and convert it to a period (Ex: Y-m-01).
phone() Check for valid U.S. phone number. Removes non-numeric characters and confirms length of string.
regex($pattern) Check against a regex pattern.
required() Check if the required value exists.
state() Check for valid U.S. state abbreviation.
zip() Check for valid U.S. zip code.

Example


All versions of validator with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3.0
hypnokizer/database Version 7.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 hypnokizer/validator contains the following files

Loading the files please wait ...