Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fapi_validation
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
fapi_validation
Commits
32a9f76e
Commit
32a9f76e
authored
3 weeks ago
by
Oleksandr Pozharskyi
Committed by
Viktor Holovachek
3 weeks ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3500209
: Use attributes for DigitValidator plugin
parent
81ff24ea
No related branches found
No related tags found
1 merge request
!54
Issue #3500209: Use attributes for DigitValidator plugin
Pipeline
#405638
canceled
3 weeks ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/FapiValidationValidator/DigitValidator.php
+8
-5
8 additions, 5 deletions
src/Plugin/FapiValidationValidator/DigitValidator.php
with
8 additions
and
5 deletions
src/Plugin/FapiValidationValidator/DigitValidator.php
+
8
−
5
View file @
32a9f76e
...
...
@@ -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 Digit validation.
*
* @FapiValidationValidator(
* id = "digit",
* error_message = "Use only digits on %field."
* )
*/
#
[
FapiValidationValidator
(
id
:
'digit'
,
label
:
new
TranslatableMarkup
(
'Alpha Numeric'
),
description
:
new
TranslatableMarkup
(
'Transform input value to digit.'
),
error_message
:
'Use only digits on %field.'
,
)]
class
DigitValidator
implements
FapiValidationValidatorsInterface
{
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment