Reference

Guide

V::size()

Checks that the value has the given size

V::size($value, $size, $operator = '=='): bool

Parameters

Name Type Default Description
$value getkirby.com/docs/reference/objects/asset/alt
$size getkirby.com/docs/reference/objects/asset/alt
$operator getkirby.com/docs/reference/objects/asset/alt '=='

Return type

bool

In your code

if(V::size(F::size('/my/file.jpg'), 12121912)) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate:
      size: 12121912

Source code

kirby/src/Toolkit/V.php#L417