2017 © Pedro Peláez
 

symfony-bundle validation-bundle

Symfony RespectValidationBundle

image

respect/validation-bundle

Symfony RespectValidationBundle

  • Wednesday, June 10, 2015
  • by henriquemoody
  • Repository
  • 10 Watchers
  • 17 Stars
  • 38 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ValidationBundle

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

A Respect\Validation Bundle for Symfony, (*2)

Installation

Package is available on Packagist, you can install it using Composer., (*3)

composer require respect/validation-bundle

Add the bundle to your AppKernel.php:, (*4)

public function registerBundles()
{
    return array(
        // ...
        new Respect\ValidationBundle\RespectValidationBundle(),
        // ...
    );
}

Usage

Use as service respect.validator

//...
class AcmeController extends Controller
{
    public function indexAction()
    {
        $number = 123;
        $isValid = $this->get('respect.validator')->numeric()->validate($number);//true
//...

Use as alias

//...

use Respect\Validation\Validator as v;

class AcmeController extends Controller
{
    public function indexAction()
    {
        $validUsername = v::alnum()
            ->noWhitespace()
            ->length(1,15);

        $isValid = $validUsername->validate('alganet'); //true
        //...

The Versions

10/06 2015

dev-master

9999999-dev http://github.com/Respect/ValidationBundle

Symfony RespectValidationBundle

  Sources   Download

The Requires

 

The Development Requires

validation