Avatar

Main class to render an avatar image of a certain Backend user, resolving any avatar provider that takes care of fetching the image.

See render() and getImgTag() as main entry points

Table of Contents

Properties

$avatarProviders  : array<string|int, AvatarProviderInterface>
Sorted and initialized avatar providers
$cache  : FrontendInterface
$dependencyOrderingService  : DependencyOrderingService
$iconFactory  : IconFactory

Methods

__construct()  : mixed
render()  : string
Renders an avatar based on a Fluid template which contains some base wrapper css classes.
getBackendUser()  : BackendUserAuthentication
getImage()  : Image
Get Image from first provider that returns one.
getImgTag()  : string
Returns an HTML <img> tag of given backend users avatar.
validateSortAndInitiateAvatarProviders()  : void
Validates the registered avatar providers

Properties

Methods

render()

Renders an avatar based on a Fluid template which contains some base wrapper css classes.

public render([array<string|int, mixed>|null $backendUser = null ][, int $size = 32 ][, bool $showIcon = false ]) : string

Has a simple caching functionality. Used in Avatar ViewHelper for instance. Renders avatar of a given backend user record, or of current logged-in backend user.

Parameters
$backendUser : array<string|int, mixed>|null = null
$size : int = 32
$showIcon : bool = false
Return values
string

getImage()

Get Image from first provider that returns one.

protected getImage(array<string|int, mixed> $backendUser, int $size) : Image
Parameters
$backendUser : array<string|int, mixed>
$size : int
Return values
Image

getImgTag()

Returns an HTML <img> tag of given backend users avatar.

protected getImgTag(array<string|int, mixed> $backendUser[, int $size = 32 ]) : string
Parameters
$backendUser : array<string|int, mixed>
$size : int = 32
Return values
string

validateSortAndInitiateAvatarProviders()

Validates the registered avatar providers

protected validateSortAndInitiateAvatarProviders() : void
Tags
throws
RuntimeException

        
On this page

Search results