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