mirror of
https://github.com/Respect/Validation.git
synced 2026-03-17 23:59:51 +01:00
The `{{name}}` placeholder could represent different things depending on
the state of the Result, and referring to it as `{{name}}` seems
arbitrary. This commit changes it to `{{subject}}`, which is much more
generic and it describes well what that placeholder can mean.
1.4 KiB
1.4 KiB
PublicDomainSuffix
PublicDomainSuffix()
Validates whether the input is a public ICANN domain suffix.
v::publicDomainSuffix->isValid('co.uk'); // true
v::publicDomainSuffix->isValid('CO.UK'); // true
v::publicDomainSuffix->isValid('nom.br'); // true
v::publicDomainSuffix->isValid('invalid.com'); // false
This rule will not match top level domains such as tk.
If you want to match either, use a combination with Tld:
v::oneOf(v::tld(), v::publicDomainSuffix())->isValid('tk'); // true
Templates
PublicDomainSuffix::TEMPLATE_STANDARD
| Mode | Template |
|---|---|
default |
{{subject}} must be a public domain suffix |
inverted |
{{subject}} must not be a public domain suffix |
Template placeholders
| Placeholder | Description |
|---|---|
subject |
The validated input or the custom validator name (if specified). |
Categorization
- Internet
Changelog
| Version | Description |
|---|---|
| 2.3.0 | Created |
See also: