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


PHP Validator::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Creates a new instance of ValidatorExtension.
  */
 public function __construct($translator, $data, $rules, $messages, array $customAttributes = [])
 {
     // Set custom validation error messages
     if (!isset($messages['vat_number'])) {
         $messages['vat_number'] = $translator->get('vatnumber-validator::validation.vat_number');
     }
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
 }
开发者ID:webcraft,项目名称:vat-calculator,代码行数:11,代码来源:VatCalculatorValidatorExtension.php

示例2: __construct

 /**
  * Create a new Validator instance.
  *
  * @param  \Symfony\Component\Translation\TranslatorInterface  $translator
  * @param  array  $data
  * @param  array  $rules
  * @param  array  $messages
  * @param  array  $customAttributes
  * @return void
  */
 public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = array(), array $customAttributes = array())
 {
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
     // add custom numeric rules
     $this->numericRules = array_merge($this->numericRules, $this->customNumericRules);
     // add custom implicit rules
     $this->implicitRules = array_merge($this->implicitRules, $this->customImplicitRules);
 }
开发者ID:moh8med,项目名称:laravel-validator,代码行数:18,代码来源:LaravelValidator.php

示例3: __construct

 public function __construct($translator, $data, $rules, $messages, array $customAttributes = array())
 {
     // Set custom validation error messages
     if (!isset($messages['null_or_exists'])) {
         $messages['null_or_exists'] = $translator->get('daylight-validator::validation.null_or_exists');
     }
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
 }
开发者ID:paulvl,项目名称:daylight,代码行数:8,代码来源:Validator.php

示例4: __construct

 /**
  * Creates a new instance of ValidatorExtension
  */
 public function __construct($translator, $data, $rules, $messages, array $customAttributes = array())
 {
     // Set custom validation error messages
     if (!isset($messages['unique_with'])) {
         $messages['unique_with'] = $translator->get('uniquewith-validator::validation.unique_with');
     }
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
 }
开发者ID:sharudee,项目名称:cos-ajax,代码行数:11,代码来源:ValidatorExtension.php

示例5: __construct

 /**
  * Creates a new instance of ValidatorExtension
  */
 public function __construct($translator, $data, $rules, $messages)
 {
     parent::__construct($translator, $data, $rules, $messages);
     // Set custom validation error messages
     if (!isset($this->messages['unique_with'])) {
         $this->messages['unique_with'] = $this->translator->get('uniquewith-validator::validation.unique_with');
     }
 }
开发者ID:sirgrimorum,项目名称:laravel-cms,代码行数:11,代码来源:ValidatorExtension.php

示例6: __construct

 public function __construct(array $data, array $rules, array $messages = array(), array $customAttributes = array())
 {
     parent::__construct(\App::make('translator'), $data, $rules, $messages, $customAttributes);
 }
开发者ID:tysonrude,项目名称:bloom7,代码行数:4,代码来源:Validator.php

示例7: __construct

 /**
  * Create a new Validator instance.
  *
  * @param  \Symfony\Component\Translation\TranslatorInterface  $translator
  * @param  array  $data
  * @param  array  $rules
  * @param  array  $messages
  * @param  array  $customAttributes
  * @return void
  */
 public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = array(), array $customAttributes = array())
 {
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
     $this->implicitRules[] = 'RequiredForDefaultLang';
 }
开发者ID:muratsplat,项目名称:multilang,代码行数:15,代码来源:NewRules.php

示例8: __construct

 /**
  * Create a new Validator instance.
  *
  * @param  \Symfony\Component\Translation\TranslatorInterface $translator
  * @param  array                                              $data
  * @param  array                                              $rules
  * @param  array                                              $messages
  *
  * @return void
  */
 public function __construct($translator, $data, $rules, $messages = [])
 {
     parent::__construct($translator, $data, $rules, $messages);
     $this->numericRules[] = 'Positive';
 }
开发者ID:nerea91,项目名称:laravel,代码行数:15,代码来源:Validator.php

示例9: __construct

 /**
  * Create a new Validator instance.
  *
  * @param  \Symfony\Component\Translation\TranslatorInterface  $translator
  * @param  array $data
  * @param  array $rules
  * @param  array $messages
  * @param  array $customAttributes
  * @return \WinkForm\Validation\WinkValidator
  */
 public function __construct(TranslatorInterface $translator, $data, $rules, $messages = array(), $customAttributes = array())
 {
     // add NotEmpty to the implicit exceptions to skipping empty string validations
     $this->implicitRules[] = 'NotEmpty';
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
 }
开发者ID:winkbrace,项目名称:winkform,代码行数:16,代码来源:WinkValidator.php

示例10: __construct

 /**
  * This method signature copied from parent class. Only reason we
  * need it is to add the implicit rule for "Exclusive With"
  *
  * @param  \Symfony\Component\Translation\TranslatorInterface  $translator
  * @param  array  $data
  * @param  array  $rules
  * @param  array  $messages
  * @param  array  $customAttributes
  * @return void
  */
 public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = array(), array $customAttributes = array())
 {
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
     // adds more "required"ish rules to run even if field absent
     $this->addImplicitExtension('ExclusiveWith', self::class . '@validateExclusiveWith');
 }
开发者ID:npmweb,项目名称:laravel-validator-custom-rules,代码行数:17,代码来源:CustomValidator.php

示例11: __construct

 public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = array(), array $customAttributes = array())
 {
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
     $this->setCustomMessages($this->msgs);
     $this->numericRules[] = 'ForeignInt';
 }
开发者ID:kevupton,项目名称:ethereal,代码行数:6,代码来源:CustomValidator.php

示例12: __construct

 public function __construct($translator, $data, $rules, $messages = array(), $customAttributes = array())
 {
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
     $this->setCustomMessages(['bf_no' => 'Please enter a valid BF Number.', 'yor' => 'The year of registration should be a valid year/month e.g 2009/3', 'address' => 'The :attribute should be a valid postal address e.g 29263 - 00100', 'cap' => 'The :attribute should be a valid CAP Link e.g http://www.beforward.jp/customer/cap?t=9acb190cbfa04474bfee0f87ccbeb61d']);
 }
开发者ID:richardkeep,项目名称:tracker,代码行数:5,代码来源:ValidationExtended.php

示例13: __construct

 public function __construct(TranslatorInterface $translator, $data, $rules, $messages = array())
 {
     parent::__construct($translator, $data, $rules, $messages);
     $this->isImplicit('fail');
 }
开发者ID:smarcet,项目名称:openstackid,代码行数:5,代码来源:CustomValidator.php

示例14: __construct

 /**
  * Create a new Validator instance.
  *
  * @param  \Symfony\Component\Translation\TranslatorInterface  $translator
  * @param  array  $data
  * @param  array  $rules
  * @param  array  $messages
  * @param  array  $customAttributes
  * @return void
  */
 public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [])
 {
     pkdebug("Making PkValidator: Translator:", $translator, "Data:", $data, "Rules:", $rules, "Messages:", $messages, "CustomAtts:", $customAttributes);
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
     //$this->setCustomMessages(['id.test'=>"Failed ID Test!", 'test'=>'Failed the Test']);
 }
开发者ID:pkirkaas,项目名称:PkExtensions,代码行数:16,代码来源:PkValidator.php

示例15: __construct

 /**
  * Create a new Validator instance.
  *
  * @param  \Symfony\Component\Translation\TranslatorInterface  $translator
  * @param  array  $data
  * @param  array  $rules
  * @param  array  $messages
  * @param  array  $customAttributes
  */
 public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = array(), array $customAttributes = array(), Neo4j $neo4j = null)
 {
     parent::__construct($translator, $data, $rules, $messages, $customAttributes);
     $this->neo4j = $neo4j;
 }
开发者ID:endyjasmi,项目名称:neo4j,代码行数:14,代码来源:Neo4jValidator.php


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