Reference

Guide

V::notIn()

Checks that the given value is not in the given list of values

V::notIn($value, $notIn): bool

Parameters

Name Type Default Description
$value getkirby.com/docs/reference/objects/asset/alt
$notIn getkirby.com/docs/reference/objects/asset/alt

Return type

bool

In your code

if(V::notIn('A', ['B', 'C', 'D'])) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate:
      notIn:
        - B
        - C
        - D

Source code

kirby/src/Toolkit/V.php#L385