Infos
- Status:
- Score: 7
- Required Symfony version: unknown
- Created: 2011-09-02
- Nb of contributors: 0
- Nb of followers: 2
- gpupo/RespectValidationBundle
Keywords
No keywords for this bundleRecommendations
Score evolution
Score details ( ? )
- Github Followers: 2
- Last 30 days activity: 0
- README file size: 5
- Uses Travis CI: 0
- Travis CI build status: 0
- Provides a composer package: 0
- KnpBundles recommendations: 0
Contributors
Latest commits
- simplificado a instalaçãoBy gpupo 7 months ago
- simplificado a instalaçãoBy gpupo 7 months ago
- doc bundles/Respect/Validation-srcBy gpupo 8 months ago
- unstable warningBy gpupo 8 months ago
- Readme fix pathBy gpupo 8 months ago
- add respect.validator serviceBy gpupo 8 months ago
- add serviceBy gpupo 8 months ago
- add bin/vendors configBy gpupo 8 months ago
- add readmeBy gpupo 8 months ago
- Initial commitBy gpupo 8 months ago
7
RespectValidationBundle by gpupo
Symfony 2 Bundle for the most awesome validation engine ever created for PHP
TODO
1. Fix false validation on service
Installation
Add reps to your deps file:
[RespectValidationBundle] git=git://github.com/gpupo/RespectValidationBundle.git target=bundles/Respect/ValidationBundle [RespectValidation] git=git://github.com/Respect/Validation.git target=Respect/Validationrun
bin/vendors install)Register the namespace
Respectto your project's autoloader bootstrap script://app/autoload.php $loader->registerNamespaces(array( // ... 'Respect' => __DIR__.'/../vendor/Respect/Validation/library', // ... ));4 Add this bundle to your application's kernel:
//app/AppKernel.php public function registerBundles() { return array( // ... new Respect\ValidationBundle\RespectValidationBundle(), // ... ); }
Usage
Use as service respect.validator (unstable):
//...
class HomeController 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 HomeController 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
-
2012-02-28 Marcelo Rodrigues -
2012-02-14 Bruno Neves
