$site->user()

Returns the currently logged in $user object. If no user is logged in, it will return false.

  • return ($user)

Example

Greeting the currently logged in user

<?php if($user = $site->user()): ?>
Hello <?= $user->username() ?>
<?php endif ?>

Fetching any user by username

<?= $site->user('bastian')->firstname() ?>