Skip to content

Kirby 5.3.0

$users->has()

Checks by key if an element is included

$users->has(string $key): bool

Parameters

Name Type Default
$keyrequired string no default value

Return type

bool

This method modifies the existing $users object it is applied to and returns it again.

Parent class

Kirby\Cms\Users inherited from Kirby\Cms\LazyCollection

<?php if ($kirby->users()->has('someone')): ?>
There exists a user with the username `someone`
<?php endif ?>