php - How to get Current Page URL in MediaWiki -
i trying current page's url , store variable in custom skin template. trying can use url other purposes. trying
function currentpageurl() //some custom function { $url= [something can current page's url in mediawiki , store variable] .....use $url variable other purposes.... ...... ..... }
does mediawiki has way can identify current page's url or option find current page using method?
$url="http://".$_server['http_host'].$_server['request_uri'];
if you're writing quicktemplate subclass skin, can title object current page using $this->getskin()->gettitle()
.
once have title object, can call getlinkurl()
on url of page. (you don't want use getprefixedurl()
ilya suggests, gives url-encoded version of page name.) or can pass title object linker::link()
if want generate standard wikilink-style link without having mess urls yourself.
in fact, $this-getskin()
general way gain access "request-global" mediawiki objects current title, webrequest, user, language, outputpage, etc. skin template. specifically, skin class implements icontextsource interface, provides access objects.
Comments
Post a Comment