Avatar

class \TYPO3\CMS\Backend\Backend\Avatar\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  : AvatarProviderInterface[]
Array of sorted and initialized avatar providers

Methods

getImage()  : Image|null
Get Image from first provider that returns one
getImgTag()  : string
Returns an HTML <img> tag for the avatar
render()  : string
Renders an avatar based on a Fluid template which contains some base wrapper classes and does a simple caching functionality, used in Avatar ViewHelper for instance
getBackendUser()  : BackendUserAuthentication
Returns the current BE user.
getCache()  : FrontendInterface
getFluidTemplateObject()  : StandaloneView
Returns a new standalone view, shorthand function
validateSortAndInitiateAvatarProviders()  : mixed
Validates the registered avatar providers

Properties

Methods

getImage()

Get Image from first provider that returns one

public getImage(array $backendUser, int $size) : Image|null

Parameters

$backendUser : array

be_users record

$size : int

Return values

Image|null

getImgTag()

Returns an HTML <img> tag for the avatar

public getImgTag([array|null $backendUser = null ][, int $size = 32 ]) : string

Parameters

$backendUser : array|null = null

be_users record

$size : int = 32

Return values

string

render()

Renders an avatar based on a Fluid template which contains some base wrapper classes and does a simple caching functionality, used in Avatar ViewHelper for instance

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

Parameters

$backendUser : array|null = null

be_users record

$size : int = 32

width and height of the image

$showIcon : bool = false

show the record icon

Return values

string

getFluidTemplateObject()

Returns a new standalone view, shorthand function

protected getFluidTemplateObject([string|null $filename = null ]) : StandaloneView

Parameters

$filename : string|null = null

Which templateFile should be used.

Return values

StandaloneView

validateSortAndInitiateAvatarProviders()

Validates the registered avatar providers

protected validateSortAndInitiateAvatarProviders() : mixed

Tags

throws
RuntimeException
On this page