Skip to content

Kirby 5.0.4

$api->user()

Returns the user object for the given id or returns the current authenticated user if no id is passed

$api->user(string|null $id = null): Kirby\Cms\User|null

Parameters

Name Type Default
$id stringornull null

Return types

Kirby\Cms\Userornull

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

Exceptions

Type Description
Kirby\Exception\NotFoundException if the user for the given id cannot be found

Parent class

Kirby\Cms\Api