Email.php in Clientside Validation 8.2
File
src/Plugin/CvValidator/Email.php
View source
<?php
namespace Drupal\clientside_validation\Plugin\CvValidator;
use Drupal\clientside_validation\CvValidatorBase;
use Drupal\Core\Form\FormStateInterface;
class Email extends CvValidatorBase {
protected function getRules($element, FormStateInterface $form_state) {
$message = $element['#email_error'] ?? $this
->t('@title does not contain a valid email.', [
'@title' => $this
->getElementTitle($element),
]);
return [
'messages' => [
'email' => $message,
],
];
}
}
Classes
Name |
Description |
Email |
Provides a 'email' validator. |