Reference

Guide

V::size()

Checks that the value has the given size

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

Parameters

Name Type Default Description
$value /docs/reference/objects/file/api-url
$size /docs/reference/objects/file/api-url
$operator /docs/reference/objects/file/api-url '=='

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#L412