Skip to content

Kirby 6.0.0

$kirby->user()

Returns a specific user by id or the current user if no id is given

$kirby->user(string|null $id = null, bool $allowImpersonation = true): User|null

Parameters

Name Type Default Description
$id stringornull null
$allowImpersonation bool true If set to false, only the actually logged in user will be returned (when $id is passed as null)

Return types

Kirby\Cms\Userornull

Parent class

Kirby\Cms\App