Skip to content

Kirby 3.9.8

url

Checks for a valid Url

V::url($value): bool

Parameters

Name Type Default
$value * mixed

Return type

bool

The URL validation may lead to incorrect results (= a valid URL being marked as invalid or the other way around) in rare edge-cases.

In your code

if(V::url('https://getkirby.com')) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate: url