Download the PHP package kkiernan/validator without Composer

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

Basic Form Validation with Session Based Messaging

This is a basic form validation class based on Laravel's [far superior] validation tools. I am writing it for my own use on simple hand-rolled projects, practice and learning. So, yeah.

Installation

The easiest way to use the class is through composer. I've added this to Packagist, again basically for my own convenience. In a terminal with composer installed, run the following:

`

Or add the package to your composer.json file and run composer install.

Validator

Usage

I am basically copying Laravel here. Create a Kiernan\Validator instance, passing it your data and validation rules. Add multiple rules to a field using the pipe separator.

Once you've created the validator instance, you can call either the Validator::fails() or Validator::passes() methods. For example:

If validation has failed, you can retrieve the error messages by calling Validator::messages().

Available Validation Rules

Session Based Messages

The examples/full example shows a hand-rolled example that uses the validator along with the session helper that is included. The session class provides a simple way of storing and retrieving messages from a session.

Usage

The session class uses the singleton pattern to present you with static methods you can call. Before use, you must first create the session instance. This just ensures that a PHP session is available to the class so that you don't have to check for/start a session in all of your scripts.

The session class has the following methods available:

Session::flash()

Add data to the session.

Session::old()

Retreive old session data. Returns null if data does not exist. You must first flash old data to the session:

And then old data can be retrieved:

Session::has()

Check to see if a key exists in the session. The following example displays a success alert using Twitter Bootstrap styles.

Session::get()

Get a value from the session if it exists. See Session::has() example.

Session::clear()

Clear the session data. This is useful at the bottom of your script if you do not want the session errors, old data, etc to persist across multiple page loads. I'd like to build this into the Session::flash() method, but for now you must call clear manually.


All versions of validator 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 kkiernan/validator contains the following files

Loading the files please wait ....