MediaWiki
REL1_34
ReplaceTextUtils.php
Go to the documentation of this file.
1
<?php
21
use \MediaWiki\MediaWikiServices;
22
23
class
ReplaceTextUtils
{
24
31
public
static
function
link
(
Title
$title
, $text =
null
) {
32
if
( method_exists(
'\MediaWiki\MediaWikiServices'
,
'getLinkRenderer'
) ) {
33
$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
34
return
$linkRenderer->makeLink(
$title
, $text );
35
};
36
$escText = htmlspecialchars( $text );
37
return
Linker::link
(
$title
, $escText );
38
}
39
}
Linker\link
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
Definition
Linker.php:85
ReplaceTextUtils
Definition
ReplaceTextUtils.php:23
ReplaceTextUtils\link
static link(Title $title, $text=null)
Shim for compatibility.
Definition
ReplaceTextUtils.php:31
Title
Represents a title within MediaWiki.
Definition
Title.php:42
$title
$title
Definition
testCompression.php:34
extensions
ReplaceText
src
ReplaceTextUtils.php
Generated on Mon Nov 25 2024 16:04:41 for MediaWiki by
1.10.0