MediaWiki 1.44.0
MediaWiki\Linker\UserLinkRenderer Class Reference

Service class that renders HTML for user-related links. More...

Public Member Functions

 __construct (TempUserConfig $tempUserConfig, SpecialPageFactory $specialPageFactory, LinkRenderer $linkRenderer, TempUserDetailsLookup $tempUserDetailsLookup)
 
 userLink (UserIdentity $targetUser, IContextSource $context, ?string $altUserName=null, array $attributes=[])
 Render a user page link (or user contributions for anonymous and temporary users).
 

Detailed Description

Service class that renders HTML for user-related links.

Since
1.44
Stability: unstable

Definition at line 24 of file UserLinkRenderer.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Linker\UserLinkRenderer::__construct ( TempUserConfig $tempUserConfig,
SpecialPageFactory $specialPageFactory,
LinkRenderer $linkRenderer,
TempUserDetailsLookup $tempUserDetailsLookup )

Definition at line 38 of file UserLinkRenderer.php.

Member Function Documentation

◆ userLink()

MediaWiki\Linker\UserLinkRenderer::userLink ( UserIdentity $targetUser,
IContextSource $context,
?string $altUserName = null,
array $attributes = [] )

Render a user page link (or user contributions for anonymous and temporary users).

Returns potentially cached link HTML.

Parameters
UserIdentity$targetUserThe user to render a link for.
IContextSource$context
string | null$altUserNameOptional text to display instead of the user name, or null to use the user name.
string[]$attributesOptional extra HTML attributes for the link.
Returns
string HTML fragment

Definition at line 65 of file UserLinkRenderer.php.


The documentation for this class was generated from the following file: