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 getkirby.com/docs/reference/objects/asset/alt
$other getkirby.com/docs/reference/objects/asset/alt
$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#L407