Reference

Guide

V::different()

Checks for a value, which does not equal the given value

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

Parameters

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

Return type

bool

In your code

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

In fields

fields:
  example:
    label: Example field
    type: text
    validate:
      different: B

Source code

kirby/src/Toolkit/V.php#L254