當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。