当前位置: 首页>>代码示例>>PHP>>正文


PHP Validator::with方法代码示例

本文整理汇总了PHP中Respect\Validation\Validator::with方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::with方法的具体用法?PHP Validator::with怎么用?PHP Validator::with使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Respect\Validation\Validator的用法示例。


在下文中一共展示了Validator::with方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: with

 /**
  * Add your own rule's namespace.
  *
  * @param string $namespace
  *
  * @codeCoverageIgnore
  */
 public function with(string $namespace, bool $overwrite = false)
 {
     RespectValidator::with($namespace, $overwrite);
 }
开发者ID:narrowspark,项目名称:framework,代码行数:11,代码来源:Validator.php

示例2: getValidationRules

 protected function getValidationRules()
 {
     v::with('app\\Models\\Validation\\');
     return [v::attribute('name', v::notEmpty()->alpha()->length(2, 100)->UniqueDimensionUOMName()), v::attribute('symbol', v::notEmpty()->alpha()->length(2, 2)->UniqueDimensionUOMSymbol()), v::attribute('routeTransaction', v::instance('app\\Models\\RouteTransaction')), v::attribute('statusId', v::notEmpty()->int()->positive()), v::attribute('createdAt', v::notEmpty()->date()), v::attribute('expiresAt', v::notEmpty()->date())];
 }
开发者ID:jamesvweston,项目名称:laravel-measurements,代码行数:5,代码来源:WeightConversion.php

示例3: getValidationRules

 protected function getValidationRules()
 {
     v::with('app\\Models\\Validation\\');
     return [v::attribute('name', v::notEmpty()->alpha()->length(2, 100)), v::attribute('symbol', v::notEmpty()->alpha()->length(2, 2)), v::attribute('statusId', v::notEmpty()->int()->positive()), v::attribute('createdAt', v::notEmpty()->date()), v::attribute('expiresAt', v::notEmpty()->date())];
 }
开发者ID:jamesvweston,项目名称:laravel-measurements,代码行数:5,代码来源:DistanceConversion.php

示例4: function

$container['flash'] = function ($container) {
    return new \Slim\Flash\Messages();
};
$container['view'] = function ($container) {
    $view = new \Slim\Views\Twig(__DIR__ . '/../resources/views/', ['cache' => false]);
    $view->addExtension(new \Slim\Views\TwigExtension($container->router, $container->request->getUri()));
    $view->getEnvironment()->addGlobal('auth', ['check' => $container->auth->check(), 'user' => $container->auth->user()]);
    $view->getEnvironment()->addGlobal('flash', $container->flash);
    return $view;
};
$container['validator'] = function ($container) {
    return new App\Validation\validator();
};
$container['HomeController'] = function ($container) {
    return new \App\Controllers\HomeController($container);
};
$container['AuthController'] = function ($container) {
    return new \App\Controllers\Auth\AuthController($container);
};
$container['PasswordController'] = function ($container) {
    return new \App\Controllers\Auth\PasswordController($container);
};
$container['csrf'] = function ($container) {
    return new \Slim\Csrf\Guard();
};
$app->add(new \App\Middleware\ValidationErrorsMiddleware($container));
$app->add(new \App\Middleware\OldInputMiddleware($container));
$app->add(new \App\Middleware\CsrfViewMiddleware($container));
$app->add($container->csrf);
v::with('App\\Validation\\Rules\\');
require __DIR__ . '/../app/routes.php';
开发者ID:havenshen,项目名称:slim-born,代码行数:31,代码来源:app.php

示例5: getValidationRules

 protected function getValidationRules()
 {
     v::with('app\\Models\\Validation\\');
     return [v::attribute('provider', v::oneOf(v::instance('app\\Models\\Provider'))), v::attribute('carrier', v::oneOf(v::instance('app\\Models\\Carrier'))), v::attribute('name', v::notEmpty()->length(3, 100)->alpha()->UniqueProviderName()), v::attribute('symbol', v::notEmpty()->length(3, 100)->UniqueProviderSymbol()), v::attribute('routeTransaction', v::instance('app\\Models\\RouteTransaction')), v::attribute('statusId', v::notEmpty()->int()->positive()), v::attribute('createdAt', v::notEmpty()->date()), v::attribute('expiresAt', v::notEmpty()->date())];
 }
开发者ID:jamesvweston,项目名称:laravel-measurements,代码行数:5,代码来源:TaxType.php

示例6: die

<?php

// Respect pulled in here because of v::with() below
use Respect\Validation\Validator as v;
//use Jsv4\Validator as jsonv;
session_start();
if (!file_exists(__DIR__ . '/settings.php')) {
    die("Error 500: application configuration problem.");
}
require __DIR__ . '/../vendor/autoload.php';
// Instantiate the app, setup the path to our custom validation rules
$config = (require __DIR__ . '/settings.php');
$app = new \Slim\App($config);
v::with('Glued\\Classes\\Validation\\Rules\\');
// Set up dependencies
require __DIR__ . '/dependencies.php';
// Register middleware
require __DIR__ . '/middleware.php';
// Register routes
require __DIR__ . '/routes.php';
/*
 * NOTE: psr-4 autoloading is turend on in composer.json. The psr-4 entry
 * "Glued\\": "glued" corresponds to the application name "Glued\" (the
 * additional backslash is for escaping) and the relative path to the "glued"
 * directory. PSR-4 will autload things according to the following key:
 * Glued=glued, Models=glued/Models, User=glued/Models/User.php, hence the
 * following will work:
 *
 *$user = new \Glued\Models\User;
 *print_r($user);
 */
开发者ID:Vaizard,项目名称:Glued,代码行数:31,代码来源:bootstrap.php


注:本文中的Respect\Validation\Validator::with方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。