MediaWiki
master
SpecialRedirectToSpecial.php
Go to the documentation of this file.
1
<?php
24
use
MediaWiki\Title\Title
;
25
31
abstract
class
SpecialRedirectToSpecial
extends
RedirectSpecialPage
{
33
protected
$redirName
;
34
36
protected
$redirSubpage
;
37
47
public
function
__construct
(
48
$name,
$redirName
,
$redirSubpage
=
false
,
49
$allowedRedirectParams = [], $addedRedirectParams = []
50
) {
51
parent::__construct( $name );
52
$this->redirName =
$redirName
;
53
$this->redirSubpage =
$redirSubpage
;
54
$this->mAllowedRedirectParams = $allowedRedirectParams;
55
$this->mAddedRedirectParams = $addedRedirectParams;
56
}
57
62
public
function
getRedirect
( $subpage ) {
63
if
( $this->redirSubpage ===
false
) {
64
return
SpecialPage::getTitleFor
( $this->redirName, $subpage );
65
}
66
67
return
SpecialPage::getTitleFor
( $this->redirName, $this->redirSubpage );
68
}
69
}
MediaWiki\Title\Title
Represents a title within MediaWiki.
Definition:
Title.php:82
RedirectSpecialPage
Shortcut to construct a special page alias.
Definition:
RedirectSpecialPage.php:33
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Definition:
SpecialPage.php:132
SpecialRedirectToSpecial
Definition:
SpecialRedirectToSpecial.php:31
SpecialRedirectToSpecial\getRedirect
getRedirect( $subpage)
Definition:
SpecialRedirectToSpecial.php:62
SpecialRedirectToSpecial\$redirName
string $redirName
Name of redirect target.
Definition:
SpecialRedirectToSpecial.php:33
SpecialRedirectToSpecial\$redirSubpage
string false $redirSubpage
Name of subpage of redirect target.
Definition:
SpecialRedirectToSpecial.php:36
SpecialRedirectToSpecial\__construct
__construct( $name, $redirName, $redirSubpage=false, $allowedRedirectParams=[], $addedRedirectParams=[])
Definition:
SpecialRedirectToSpecial.php:47
includes
specialpage
SpecialRedirectToSpecial.php
Generated on Sun May 28 2023 23:09:18 for MediaWiki by
1.9.1