Skip to content
Snippets Groups Projects
Commit 0dd0f94a authored by Ihor Mashevskyi's avatar Ihor Mashevskyi Committed by Viktor Holovachek
Browse files

Issue #3500206: Use attributes for AlphaValidator plugin

parent 32a9f76e
No related branches found
No related tags found
1 merge request!55Issue #3500206: Use attributes for AlphaValidator plugin
Pipeline #405643 passed with warnings
......@@ -3,17 +3,20 @@
namespace Drupal\fapi_validation\Plugin\FapiValidationValidator;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\fapi_validation\Attribute\FapiValidationValidator;
use Drupal\fapi_validation\FapiValidationValidatorsInterface;
use Drupal\fapi_validation\Validator;
/**
* Fapi Validation Plugin for Alpha validation.
*
* @FapiValidationValidator(
* id = "alpha",
* error_message = "Use only alpha characters at %field."
* )
*/
#[FapiValidationValidator(
id: 'alpha',
label: new TranslatableMarkup('Alpha'),
description: new TranslatableMarkup('Validate input value length.'),
error_message: 'Use only alpha characters at %field.',
)]
class AlphaValidator implements FapiValidationValidatorsInterface {
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment