本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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');
}
}
示例6: __construct
public function __construct(array $data, array $rules, array $messages = array(), array $customAttributes = array())
{
parent::__construct(\App::make('translator'), $data, $rules, $messages, $customAttributes);
}
示例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';
}
示例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';
}
示例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);
}
示例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');
}
示例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';
}
示例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']);
}
示例13: __construct
public function __construct(TranslatorInterface $translator, $data, $rules, $messages = array())
{
parent::__construct($translator, $data, $rules, $messages);
$this->isImplicit('fail');
}
示例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']);
}
示例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;
}