MediaWiki  1.34.0
ReplaceTextUtils.php
Go to the documentation of this file.
1 <?php
21 use \MediaWiki\MediaWikiServices;
22 
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 }
ReplaceTextUtils\link
static link(Title $title, $text=null)
Shim for compatibility.
Definition: ReplaceTextUtils.php:31
$title
$title
Definition: testCompression.php:34
Linker\link
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
Definition: Linker.php:85
Title
Represents a title within MediaWiki.
Definition: Title.php:42
ReplaceTextUtils
Definition: ReplaceTextUtils.php:23