Reference

Guide

V::between()

Checks for numbers within the given range

V::between($value, $min, $max): bool

Parameters

Name Type Default Description
$value /docs/reference/objects/file/api-url
$min /docs/reference/objects/file/api-url
$max /docs/reference/objects/file/api-url

Return type

bool

In your code

if(v::between($input, 5, 20)) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate:
      between:
        - 5
        - 20

Source code

kirby/src/Toolkit/V.php#L222