MediaWiki  1.23.2
PageLinkRenderer Interface Reference

Represents a link rendering service for MediaWiki. More...

Inheritance diagram for PageLinkRenderer:

Public Member Functions

 getPageUrl (TitleValue $page, $params=array())
 Returns the URL for the given page. More...
 
 renderHtmlLink (TitleValue $page, $text=null)
 Returns an HTML link to the given page, using the given surface text. More...
 
 renderWikitextLink (TitleValue $page, $text=null)
 Returns a wikitext link to the given page, using the given surface text. More...
 

Detailed Description

Represents a link rendering service for MediaWiki.

This is designed to encapsulate the knowledge about how page titles map to URLs, and how links are encoded in a given output format.

See also
https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue

Definition at line 33 of file PageLinkRenderer.php.

Member Function Documentation

◆ getPageUrl()

PageLinkRenderer::getPageUrl ( TitleValue  $page,
  $params = array() 
)

Returns the URL for the given page.

Todo:
expand this to cover the functionality of Linker::linkUrl
Parameters
TitleValue$pageThe link's target
array$paramsany additional URL parameters.
Returns
string

Implemented in MediaWikiPageLinkRenderer.

◆ renderHtmlLink()

PageLinkRenderer::renderHtmlLink ( TitleValue  $page,
  $text = null 
)

Returns an HTML link to the given page, using the given surface text.

Todo:
expand this to cover the functionality of Linker::link
Parameters
TitleValue$pageThe link's target
string$textThe link's surface text (will be derived from $page if not given).
Returns
string

Implemented in MediaWikiPageLinkRenderer.

◆ renderWikitextLink()

PageLinkRenderer::renderWikitextLink ( TitleValue  $page,
  $text = null 
)

Returns a wikitext link to the given page, using the given surface text.

Parameters
TitleValue$pageThe link's target
string$textThe link's surface text (will be derived from $page if not given).
Returns
string

Implemented in MediaWikiPageLinkRenderer.


The documentation for this interface was generated from the following file: