2017 © Pedro Peláez
 

library phprest-service-validator

Phprest Validator Service.

image

phprest/phprest-service-validator

Phprest Validator Service.

  • Monday, June 29, 2015
  • by phprest
  • Repository
  • 1 Watchers
  • 1 Stars
  • 302 Installations
  • PHP
  • 3 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown

The README.md

Phprest Validator Service

Author Software License, (*1)

Description

Validator Service which uses the Symfony\Validator component., (*2)

Installation

Install it through composer., (*3)

{
    "require": {
        "phprest/phprest-service-validator": "@stable"
    }
}

tip: you should browse the phprest/phprest-service-validator page to choose a stable version to use, avoid the @stable meta constraint., (*4)

Usage

Configuration

For the configuration you should check the Config class., (*5)

Registration

use Phprest\Service\Validator;
# ...
/** @var \Phprest\Application $app */

$app->registerService(new Validator\Service(), new Validator\Config());
# ...

Reaching from a Controller

To reach your Service from a Controller you should use the Service's Getter Trait., (*6)

<?php namespace App\Module\Controller;

use Phprest\Service;

class Index extends \Phprest\Util\Controller
{
    use Service\Validator\Getter;

    public function post(Request $request)
    {
        $this->serviceValidator()->validate(...);
    }
}

Utils

Most of the Services in Phprest provides some utility mechanism (helper functions)., (*7)

For the utilities you should check the Util class., (*8)

The Versions

29/06 2015

dev-master

9999999-dev

Phprest Validator Service.

  Sources   Download

MIT

The Requires

 

api service framework rest validator restful