Skip to content

Kirby 4.3.0


Validates the field content with the given validator and parameters

$field->isValid(string $validator, mixed ...$arguments = null): bool


Name Type Default Description
$validator * string
... $arguments mixed null A list of optional validator arguments

Return type



You can use the following aliases for this field method in your template:

  • $field->v(…)


For validators, see list of available validators. In addition, you can use custom validators.


<?php if ($page->email()->isValid('email')): ?>
The email address in the email field seems to be valid
<?php endif ?>

Some validators require additional arguments:

<?php if ($page->title()->isValid('maxLength', 45)): ?>
The text length is valid
<?php endif ?>
<?php if ($page->number()->isValid('between', 5, 10)): ?>
The number is between 5 and 10
<?php endif ?>