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
d70e9495
Commit
d70e9495
authored
3 weeks ago
by
Viktor Holovachek
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3500219
- Add attributes
parent
ed92f1ff
No related branches found
No related tags found
1 merge request
!49
Issue #3500219 - Add attributes
Pipeline
#405582
passed with warnings
3 weeks ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/FapiValidationValidator/UrlValidator.php
+8
-5
8 additions, 5 deletions
src/Plugin/FapiValidationValidator/UrlValidator.php
with
8 additions
and
5 deletions
src/Plugin/FapiValidationValidator/UrlValidator.php
+
8
−
5
View file @
d70e9495
...
...
@@ -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
{
/**
...
...
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