MediaWiki  1.34.4
SpecialRedirectToSpecial.php
Go to the documentation of this file.
1 <?php
29  protected $redirName;
30 
32  protected $redirSubpage;
33 
34  function __construct(
35  $name, $redirName, $redirSubpage = false,
36  $allowedRedirectParams = [], $addedRedirectParams = []
37  ) {
38  parent::__construct( $name );
39  $this->redirName = $redirName;
40  $this->redirSubpage = $redirSubpage;
41  $this->mAllowedRedirectParams = $allowedRedirectParams;
42  $this->mAddedRedirectParams = $addedRedirectParams;
43  }
44 
49  public function getRedirect( $subpage ) {
50  if ( $this->redirSubpage === false ) {
51  return SpecialPage::getTitleFor( $this->redirName, $subpage );
52  }
53 
54  return SpecialPage::getTitleFor( $this->redirName, $this->redirSubpage );
55  }
56 }
SpecialRedirectToSpecial\$redirSubpage
string $redirSubpage
Name of subpage of redirect target.
Definition: SpecialRedirectToSpecial.php:32
SpecialRedirectToSpecial\__construct
__construct( $name, $redirName, $redirSubpage=false, $allowedRedirectParams=[], $addedRedirectParams=[])
Definition: SpecialRedirectToSpecial.php:34
SpecialRedirectToSpecial\getRedirect
getRedirect( $subpage)
Definition: SpecialRedirectToSpecial.php:49
SpecialRedirectToSpecial
Definition: SpecialRedirectToSpecial.php:27
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:83
RedirectSpecialPage
Shortcut to construct a special page alias.
Definition: RedirectSpecialPage.php:29
SpecialRedirectToSpecial\$redirName
string $redirName
Name of redirect target.
Definition: SpecialRedirectToSpecial.php:29