Skip to content
Snippets Groups Projects
Commit d70e9495 authored by Viktor Holovachek's avatar Viktor Holovachek
Browse files

Issue #3500219 - Add attributes

parent ed92f1ff
No related branches found
No related tags found
1 merge request!49Issue #3500219 - Add attributes
Pipeline #405582 passed with warnings
......@@ -4,17 +4,20 @@ namespace Drupal\fapi_validation\Plugin\FapiValidationValidator;
use Drupal\Component\Utility\UrlHelper;
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 URL validation.
*
* @FapiValidationValidator(
* id = "url",
* error_message = "Invalid format of %field."
* )
*/
#[FapiValidationValidator(
id: 'url',
label: new TranslatableMarkup('URL'),
description: new TranslatableMarkup('Validates an URL address.'),
error_message: 'Invalid format of %field.',
)]
class UrlValidator 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