Added vendor/ directory for Composer's installed files

This commit is contained in:
Ascendings
2015-08-30 12:33:20 -04:00
parent 45df179c49
commit b66a773ed8
1162 changed files with 112457 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<?php
/**
* Violin example. All errors.
*
* Simply getting a list of errors that occured while trying
* to validate the data passed in against the rules given.
*/
require '../../vendor/autoload.php';
use Violin\Violin;
$v = new Violin;
$v->validate([
'username' => ['dalegarrett1234567890', 'required|alpha|min(3)|max(20)'],
'email' => ['dale.codecourse.com', 'required|email']
]);
var_dump($v->errors()->all()); // Array of all errors.

View File

@ -0,0 +1,22 @@
<?php
/**
* Violin example. Errors for a specific field.
*
* Simply getting a list of errors for a specific field that
* occured while trying to validate the data passed in
* against the rules given.
*/
require '../../vendor/autoload.php';
use Violin\Violin;
$v = new Violin;
$v->validate([
'username' => ['dalegarrett1234567890', 'required|alpha|min(3)|max(20)'],
'email' => ['dale.codecourse.com', 'required|email']
]);
var_dump($v->errors()->get('username')); // Array of all 'username' errors.

View File

@ -0,0 +1,25 @@
<?php
/**
* Violin example. Checking and getting first error.
*
* This checks a specific field has an error, and then outputs
* the first error that occured for that field. This is most
* likely what you'd use in a real life situation within
* your HTML form.
*/
require '../../vendor/autoload.php';
use Violin\Violin;
$v = new Violin;
$v->validate([
'username' => ['dalegarrett1234567890', 'required|alpha|min(3)|max(20)'],
'email' => ['dale.codecourse.com', 'required|email']
]);
if ($v->errors()->has('email')) { // Check if any errors exist for 'email'.
echo $v->errors()->first('email'); // First 'email' error (string).
}