$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 <?php echo $user->username() ?>
<?php endif ?>

Fetching any user by username

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