Reference

Guide

V::same()

Checks that the first value equals the second value

V::same($value, $other, bool $strict = false): bool

Parameters

Name Type Default Description
$value /docs/reference/objects/file/api-url
$other /docs/reference/objects/file/api-url
$strict bool false

Return type

bool

In your code

if(v::same('A', 'A')) {
  echo 'Yay, valid!';
}

In Panel fields

fields:
  example:
    label: Example field
    type: text
    validate:
      equals: A

Source code

kirby/src/Toolkit/V.php#L402