RegexConstraint.php in Zircon Profile 8
Same filename and directory in other branches
File
core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.phpView source
<?php
/**
* @file
* Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\RegexConstraint.
*/
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraints\Regex;
/**
* Regex constraint.
*
* Overrides the symfony constraint to use Drupal-style replacement patterns.
*
* @Constraint(
* id = "Regex",
* label = @Translation("Regex", context = "Validation")
* )
*/
class RegexConstraint extends Regex {
public $message = 'This value is not valid.';
/**
* {@inheritdoc}
*/
public function validatedBy() {
return '\\Symfony\\Component\\Validator\\Constraints\\RegexValidator';
}
}
Classes
Name | Description |
---|---|
RegexConstraint | Regex constraint. |