Skip to content
Snippets Groups Projects

Issue #3500219 - Add attributes

1 file
+ 8
5
Compare changes
  • Side-by-side
  • Inline
@@ -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 {
/**
Loading