Go to the documentation of this file.
4 public function register() {
6 'anchorEncode' => [ $this,
'anchorEncode' ],
7 'localUrl' => [ $this,
'localUrl' ],
8 'fullUrl' => [ $this,
'fullUrl' ],
9 'canonicalUrl' => [ $this,
'canonicalUrl' ],
12 return $this->
getEngine()->registerInterface(
'mw.uri.lua', $lib, [
13 'defaultUrl' => $this->
getTitle()->getFullUrl(),
29 private function getUrl( $func, $page, $query ) {
35 # Convert NS_MEDIA -> NS_FILE
39 if ( $query !==
null ) {
40 $text =
$title->$func( $query );
58 return $this->
getUrl(
'getLocalURL', $page, $query );
68 public function fullUrl( $page, $query ) {
69 return $this->
getUrl(
'getFullURL', $page, $query );
80 return $this->
getUrl(
'getCanonicalURL', $page, $query );
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
fullUrl( $page, $query)
Handler for fullUrl.
getEngine()
Get the engine.
getParser()
Get the parser.
anchorEncode( $s)
Handler for anchorEncode.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
localUrl( $page, $query)
Handler for localUrl.
This class provides some basic services that Lua libraries will probably need.
canonicalUrl( $page, $query)
Handler for canonicalUrl.
static newFromURL( $url)
THIS IS NOT THE FUNCTION YOU WANT.
static anchorencode( $parser, $text)
getUrl( $func, $page, $query)