‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\ViewHelpers\AvatarViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Backend\ViewHelpers\AvatarViewHelper:

Public Member Functions

 initializeArguments ()
 

Static Public Member Functions

static renderStatic (array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 

Protected Attributes

bool $escapeOutput = false
 

Detailed Description

Render the avatar markup, including the :html:<img> tag, for a given backend user.

Examples

Default

::

<be:avatar backendUser="{user.uid}" size="32" showIcon="true" />

Output::

If the given backend user hasn't added a custom avatar yet, a default one is used.

Inline notation

::

{be:avatar(backendUser: user.id, size: 32, showIcon: 'true')}

Output::

Definition at line 66 of file AvatarViewHelper.php.

Member Function Documentation

◆ initializeArguments()

TYPO3\CMS\Backend\ViewHelpers\AvatarViewHelper::initializeArguments ( )

Definition at line 75 of file AvatarViewHelper.php.

◆ renderStatic()

static TYPO3\CMS\Backend\ViewHelpers\AvatarViewHelper::renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static

Resolve user avatar from a given backend user id.

Parameters
array{backendUser‪int, size: int, showIcon: bool} $arguments

Definition at line 87 of file AvatarViewHelper.php.

References $GLOBALS, and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

Member Data Documentation

◆ $escapeOutput

bool TYPO3\CMS\Backend\ViewHelpers\AvatarViewHelper::$escapeOutput = false
protected

As this ViewHelper renders HTML, the output must not be escaped.

Definition at line 73 of file AvatarViewHelper.php.