MediaWiki master
MediaWiki\Linker\UserLinkRenderer Class Reference

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

Public Member Functions

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

Protected Member Functions

 isFromExternalWiki ( $wikiId)
 Checks whether a given wiki identifier belongs to an external wiki.
 

Detailed Description

Service class that renders HTML for user-related links.

Since
1.44
Stability: unstable

Definition at line 30 of file UserLinkRenderer.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 47 of file UserLinkRenderer.php.

Member Function Documentation

◆ isFromExternalWiki()

MediaWiki\Linker\UserLinkRenderer::isFromExternalWiki ( $wikiId)
protected

Checks whether a given wiki identifier belongs to an external wiki.

Parameters
string | false$wikiIdID to check
Returns
bool true if the ID belongs to an external wiki, false otherwise.

Definition at line 300 of file UserLinkRenderer.php.

◆ 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 78 of file UserLinkRenderer.php.

References MediaWiki\DAO\WikiAwareEntity\getWikiId().


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