Class that generates HTML anchor link elements for pages.
More...
|
| __construct (TitleFormatter $titleFormatter, LinkCache $linkCache, SpecialPageFactory $specialPageFactory, HookContainer $hookContainer, ServiceOptions $options) |
|
| getExpandURLs () |
|
| getForceArticlePath () |
|
| getLinkClasses ( $target) |
| Return the CSS classes of a known link.
|
|
| getStubThreshold () |
|
| isForComment () |
|
| makeBrokenLink ( $target, $text=null, array $extraAttribs=[], array $query=[]) |
|
| makeKnownLink ( $target, $text=null, array $extraAttribs=[], array $query=[]) |
|
| makeLink ( $target, $text=null, array $extraAttribs=[], array $query=[]) |
|
| makePreloadedLink ( $target, $text=null, $classes='', array $extraAttribs=[], array $query=[]) |
| If you have already looked up the proper CSS classes using LinkRenderer::getLinkClasses() or some other method, use this to avoid looking it up again.
|
|
| normalizeTarget ( $target) |
| Normalizes the provided target.
|
|
| setExpandURLs ( $expand) |
|
| setForceArticlePath ( $force) |
|
| setStubThreshold ( $threshold) |
|
Class that generates HTML anchor link elements for pages.
- See also
- https://www.mediawiki.org/wiki/Manual:LinkRenderer
- Since
- 1.28
Definition at line 43 of file LinkRenderer.php.
◆ __construct()
◆ buildAElement()
MediaWiki\Linker\LinkRenderer::buildAElement |
( |
|
$target, |
|
|
|
$text, |
|
|
array |
$attribs, |
|
|
|
$isKnown |
|
) |
| |
|
private |
Builds the final element.
- Parameters
-
LinkTarget | PageReference | $target | |
string | HtmlArmor | $text | |
array | $attribs | |
bool | $isKnown | |
- Returns
- null|string
Definition at line 328 of file LinkRenderer.php.
◆ castToLinkTarget()
MediaWiki\Linker\LinkRenderer::castToLinkTarget |
( |
|
$target | ) |
|
|
private |
- Parameters
-
LinkTarget | PageReference | $target | |
- Returns
- LinkTarget
Definition at line 470 of file LinkRenderer.php.
◆ castToTitle()
MediaWiki\Linker\LinkRenderer::castToTitle |
( |
|
$target | ) |
|
|
private |
◆ getExpandURLs()
MediaWiki\Linker\LinkRenderer::getExpandURLs |
( |
| ) |
|
◆ getForceArticlePath()
MediaWiki\Linker\LinkRenderer::getForceArticlePath |
( |
| ) |
|
◆ getLinkClasses()
MediaWiki\Linker\LinkRenderer::getLinkClasses |
( |
|
$target | ) |
|
Return the CSS classes of a known link.
- Parameters
-
LinkTarget | PageReference | $target | |
- Returns
- string CSS class
Definition at line 432 of file LinkRenderer.php.
◆ getLinkText()
MediaWiki\Linker\LinkRenderer::getLinkText |
( |
|
$target | ) |
|
|
private |
◆ getLinkURL()
MediaWiki\Linker\LinkRenderer::getLinkURL |
( |
|
$target, |
|
|
|
$query = [] |
|
) |
| |
|
private |
◆ getStubThreshold()
MediaWiki\Linker\LinkRenderer::getStubThreshold |
( |
| ) |
|
◆ isForComment()
MediaWiki\Linker\LinkRenderer::isForComment |
( |
| ) |
|
◆ makeBrokenLink()
MediaWiki\Linker\LinkRenderer::makeBrokenLink |
( |
|
$target, |
|
|
|
$text = null , |
|
|
array |
$extraAttribs = [] , |
|
|
array |
$query = [] |
|
) |
| |
◆ makeKnownLink()
MediaWiki\Linker\LinkRenderer::makeKnownLink |
( |
|
$target, |
|
|
|
$text = null , |
|
|
array |
$extraAttribs = [] , |
|
|
array |
$query = [] |
|
) |
| |
- Parameters
-
LinkTarget | PageReference | $target | |
string | HtmlArmor | null | $text | |
array | $extraAttribs | |
array | $query | |
- Returns
- string HTML
Definition at line 237 of file LinkRenderer.php.
Referenced by MovePageForm\doSubmit(), SpecialTags\doTagRow(), SpecialListGroupRights\execute(), SpecialPasswordPolicies\execute(), SpecialAncientPages\formatResult(), SpecialBrokenRedirects\formatResult(), SpecialDoubleRedirects\formatResult(), SpecialFewestRevisions\formatResult(), SpecialMostCategories\formatResult(), SpecialMostInterwikis\formatResult(), SpecialShortPages\formatResult(), SpecialUnusedTemplates\formatResult(), SpecialUnwatchedPages\formatResult(), SpecialMergeHistory\formatRevisionRow(), AllMessagesTablePager\formatValue(), ProtectedPagesPager\formatValue(), BlockListPager\formatValue(), BlockLogFormatter\getActionLinks(), DeleteLogFormatter\getActionLinks(), ProtectLogFormatter\getActionLinks(), TraditionalImageGallery\getCaptionHtml(), SpecialBotPasswords\getFormFields(), SpecialStatistics\getGroupStats(), SpecialStatistics\getPageStats(), Article\getRedirectHeaderHtml(), SpecialDeletedContributions\getSubTitle(), ImagePage\imageDupes(), ImagePage\imageLinks(), SpecialMostLinked\makeWlhLink(), ImagePage\openShowImage(), InfoAction\pageInfo(), SpecialBlock\postText(), SpecialAllPages\showChunk(), SpecialEditTags\showConvenienceLinks(), SpecialRevisionDelete\showConvenienceLinks(), SpecialRevisionDelete\showForm(), SpecialUndelete\showList(), SpecialUploadStash\showUploads(), and SpecialUpload\showUploadWarning().
◆ makeLink()
MediaWiki\Linker\LinkRenderer::makeLink |
( |
|
$target, |
|
|
|
$text = null , |
|
|
array |
$extraAttribs = [] , |
|
|
array |
$query = [] |
|
) |
| |
- Parameters
-
LinkTarget | PageReference | $target | |
string | HtmlArmor | null | $text | |
array | $extraAttribs | |
array | $query | |
- Returns
- string HTML
Definition at line 170 of file LinkRenderer.php.
Referenced by MovePageForm\doSubmit(), SpecialTags\doTagRow(), SpecialListGroupRights\execute(), SpecialPasswordPolicies\execute(), SpecialTrackingCategories\execute(), SpecialNewpages\filterLinks(), SpecialFileDuplicateSearch\formatResult(), WantedQueryPage\formatResult(), SpecialBrokenRedirects\formatResult(), SpecialDoubleRedirects\formatResult(), SpecialFewestRevisions\formatResult(), SpecialListRedirects\formatResult(), SpecialMIMESearch\formatResult(), SpecialMostCategories\formatResult(), SpecialMostInterwikis\formatResult(), SpecialMostLinked\formatResult(), SpecialShortPages\formatResult(), ProtectedPagesPager\formatValue(), ProtectLogFormatter\getActionLinks(), SpecialEmailUser\getFormFields(), SpecialStatistics\getGroupStats(), Article\getRedirectHeaderHtml(), BlockListPager\getRestrictionListHTML(), SpecialDeletedContributions\getSubTitle(), SpecialMergeHistory\merge(), SpecialListGroupRights\outputNamespaceProtectionInfo(), SpecialMediaStatistics\outputTableRow(), InfoAction\pageInfo(), SpecialBlock\postText(), SpecialAllPages\showChunk(), SpecialChangeCredentials\showSubpageList(), and MovePageForm\showSubpagesList().
◆ makePreloadedLink()
MediaWiki\Linker\LinkRenderer::makePreloadedLink |
( |
|
$target, |
|
|
|
$text = null , |
|
|
|
$classes = '' , |
|
|
array |
$extraAttribs = [] , |
|
|
array |
$query = [] |
|
) |
| |
If you have already looked up the proper CSS classes using LinkRenderer::getLinkClasses() or some other method, use this to avoid looking it up again.
- Parameters
-
LinkTarget | PageReference | $target | |
string | HtmlArmor | null | $text | |
string | $classes | CSS classes to add |
array | $extraAttribs | |
array | $query | |
- Returns
- string
Definition at line 201 of file LinkRenderer.php.
◆ mergeAttribs()
MediaWiki\Linker\LinkRenderer::mergeAttribs |
( |
|
$defaults, |
|
|
|
$attribs |
|
) |
| |
|
private |
Merges two sets of attributes.
- Parameters
-
array | $defaults | |
array | $attribs | |
- Returns
- array
Definition at line 409 of file LinkRenderer.php.
◆ normalizeTarget()
MediaWiki\Linker\LinkRenderer::normalizeTarget |
( |
|
$target | ) |
|
Normalizes the provided target.
- Access: internal
- For use by deprecated Linker & DummyLinker ::normaliseSpecialPage() methods
- Parameters
-
LinkTarget | PageReference | $target | |
- Returns
- LinkTarget
Definition at line 383 of file LinkRenderer.php.
References NS_SPECIAL.
◆ runBeginHook()
MediaWiki\Linker\LinkRenderer::runBeginHook |
( |
|
$target, |
|
|
& |
$text, |
|
|
& |
$extraAttribs, |
|
|
& |
$query, |
|
|
|
$isKnown |
|
) |
| |
|
private |
◆ setExpandURLs()
MediaWiki\Linker\LinkRenderer::setExpandURLs |
( |
|
$expand | ) |
|
- Parameters
-
string | bool | int | $expand | A PROTO_* constant or false |
Definition at line 130 of file LinkRenderer.php.
◆ setForceArticlePath()
MediaWiki\Linker\LinkRenderer::setForceArticlePath |
( |
|
$force | ) |
|
◆ setStubThreshold()
MediaWiki\Linker\LinkRenderer::setStubThreshold |
( |
|
$threshold | ) |
|
◆ $comment
bool MediaWiki\Linker\LinkRenderer::$comment = false |
|
private |
Whether links are being rendered for comments.
Definition at line 68 of file LinkRenderer.php.
◆ $expandUrls
string bool int MediaWiki\Linker\LinkRenderer::$expandUrls = false |
|
private |
◆ $forceArticlePath
bool MediaWiki\Linker\LinkRenderer::$forceArticlePath = false |
|
private |
◆ $hookRunner
HookRunner MediaWiki\Linker\LinkRenderer::$hookRunner |
|
private |
◆ $linkCache
LinkCache MediaWiki\Linker\LinkRenderer::$linkCache |
|
private |
◆ $specialPageFactory
◆ $titleFormatter
◆ CONSTRUCTOR_OPTIONS
const MediaWiki\Linker\LinkRenderer::CONSTRUCTOR_OPTIONS |
The documentation for this class was generated from the following file: