Skip to content

Kirby 4.4.1

filename

Checks for a valid filename

V::filename($value): bool

Parameters

Name Type Default
$value * mixed

Return type

bool

In your code

if(V::filename('myfile.jpg')) {
  echo 'Yay, valid!';
}

In fields

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