2017 © Pedro Peláez
 

symfony-bundle respect-validation-bundle

Integration of the respect/validation with Symfony2.1 or higher

image

tear/respect-validation-bundle

Integration of the respect/validation with Symfony2.1 or higher

  • Wednesday, May 7, 2014
  • by leonnleite
  • Repository
  • 3 Watchers
  • 0 Stars
  • 1,995 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

Tear\RespectValidationBundle

better integration between Symfony2 and "The most awesome validation engine ever created for PHP.", (*1)

Installation

Bring in the vendor libraries

Use Composer, (*2)

// composer.json
"require": {
    "php": ">=5.3.2",
    // ...
    "tear/respect-validation-bundle": "dev-master",
    // ...
}

Add to your application kernel

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...            
        new Tear\Respect\ValidationBundle\TearRespectValidationBundle(),
        // ...
    );
}

Usage

Use as service respect.validator:

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

Use as Alias:

    <?php

    namespace Acme\DemoBundle\Controller;

    use Symfony\Bundle\FrameworkBundle\Controller\Controller;
    use Respect\Validation\Validator as v;
    class AcmeController extends Controller
    {

        public function indexAction()
        {

            $validUsername = v::alnum()
            ->noWhitespace()
            ->length(1,15);

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

Documentation

See documentation on https://github.com/Respect/Validation, (*3)

The Versions

07/05 2014

dev-master

9999999-dev

Integration of the respect/validation with Symfony2.1 or higher

  Sources   Download

MIT

The Requires

 

by Leonn Leite

validation symfony2 bundle respect

23/07 2013

0.1.0

0.1.0.0

Integration of the respect/validation with Symfony2.1 or higher

  Sources   Download

MIT

The Requires

 

by Leonn Leite

validation symfony2 bundle respect