承接 phprest/phprest-service-validator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phprest/phprest-service-validator

Composer 安装命令:

composer require phprest/phprest-service-validator

包简介

Phprest Validator Service.

README 文档

README

Author Software License

Description

Validator Service which uses the Symfony\Validator component.

Installation

Install it through composer.

{
    "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.

Usage

Configuration

For the configuration you should check the Config class.

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.

<?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).

For the utilities you should check the Util class.

统计信息

  • 总下载量: 883
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 3

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固