Skip to content
This repository has been archived by the owner on Apr 21, 2018. It is now read-only.

saxulum-legacy/saxulum-validator-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

saxulum-validator-provider

works with plain silex-php

Build Status Total Downloads Latest Stable Version Scrutinizer Code Quality

Features

  • Register validators

Requirements

  • php >=5.3
  • symfony/validator >=2.3

Annotation

  • doctrine/annotations ~1.0

Xml

  • symfony/config >=2.3

Yaml

  • symfony/config >=2.3
  • symfony/yaml >=2.3

Installation

Through Composer as saxulum/saxulum-validator-provider.

use Silex\Provider\ValidatorServiceProvider;
use Saxulum\Validator\Provider\SaxulumValidatorProvider;

$container->register(new ValidatorServiceProvider());
$container->register(new SaxulumValidatorProvider());

Annotation

\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

XML

Register xml files.

$container['validator.loader.xml.files'] = $container->extend('validator.loader.xml.files', function ($files) {
    $files[] = __DIR__ . '/../../Fixtures/test.xml';
    return $files;
});

YAML

Register yml files.

$container['validator.loader.yaml.files'] = $container->extend('validator.loader.yaml.files', function ($files) {
    $files[] = __DIR__ . '/../../Fixtures/test.yaml';
    return $files;
});

Usage

$container['validator']->validate($object);

About

Advanced Validator based on the original ones of silex.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages