mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 20:48:46 +02:00
N°6414 Validator refactoring
New AbstractValidator class, with new method Validate All existing validators are now children of AbstractRegexpValidator Handle validators JS counterparts in renderers : only regexp validators are implemented client side
This commit is contained in:
22
sources/Form/Validator/CustomRegexpValidator.php
Normal file
22
sources/Form/Validator/CustomRegexpValidator.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Form\Validator;
|
||||
|
||||
/**
|
||||
* @since 3.1.0 N°6414
|
||||
*/
|
||||
class CustomRegexpValidator extends AbstractRegexpValidator
|
||||
{
|
||||
public const VALIDATOR_NAME = 'custom_regexp';
|
||||
|
||||
public function __construct(string $sRegExp, ?string $sErrorMessage = null)
|
||||
{
|
||||
parent::__construct($sErrorMessage);
|
||||
|
||||
$this->sRegExp = $sRegExp; // must be done after parent constructor call !
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user