Reference

$field->isValid()

Validates the field content with the given validator and parameters

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

Parameters

Name Type Default Description
$validator string
$arguments array null

A list of optional validator arguments

Return type

bool

Example

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

Source code

kirby/config/methods.php#L52