Skip to content

Kirby 4.4.1

integer

Checks for a valid integer

V::integer($value, bool $strict = false): bool

Parameters

Name Type Default
$value * mixed
$strict bool false

Return type

bool

In your code

if(V::integer(12)) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate: integer