/** * Returns a wikitext link to the given page, using the given surface text. * * @param TitleValue $page The link's target * @param string $text The link's surface text (will be derived from $page if not given). * * @return string */ public function renderWikitextLink(TitleValue $page, $text = null) { if ($text === null) { $text = $this->formatter->getFullText($page); } $name = $this->formatter->getFullText($page); return '[[:' . $name . '|' . wfEscapeWikiText($text) . ']]'; }