Skip to content

Kirby 4.4.1

callback

Checks with the callback sent by the user It's ideal for one-time custom validations

V::callback($value, callable $callback): bool

Parameters

Name Type Default
$value * mixed
$callback * callable

Return type

bool

In your code

V::callback(
    ['green', 'blue'],
    fn ($value) => count($value) === count(array_intersect($value, ['red', 'green', 'blue']))
);