$user->avatar()
Returns the user avatar object if the avatar exists
-
return ($avatar)
Example
<?php if($avatar = $site->user('bastian')->avatar()): ?>
<img src="<?= $avatar->url() ?>" alt="Bastian's avatar">
<?php endif ?>
Avatar storage
All avatars must go into /assets/avatars
.
Avatars can be jpg, gif or png files and must have the username as filename.