MediaWiki  master
SpecialRedirectToSpecial.php
Go to the documentation of this file.
1 <?php
31  protected $redirName;
32 
34  protected $redirSubpage;
35 
45  public function __construct(
46  $name, $redirName, $redirSubpage = false,
47  $allowedRedirectParams = [], $addedRedirectParams = []
48  ) {
49  parent::__construct( $name );
50  $this->redirName = $redirName;
51  $this->redirSubpage = $redirSubpage;
52  $this->mAllowedRedirectParams = $allowedRedirectParams;
53  $this->mAddedRedirectParams = $addedRedirectParams;
54  }
55 
60  public function getRedirect( $subpage ) {
61  if ( $this->redirSubpage === false ) {
62  return SpecialPage::getTitleFor( $this->redirName, $subpage );
63  }
64 
65  return SpecialPage::getTitleFor( $this->redirName, $this->redirSubpage );
66  }
67 }
SpecialRedirectToSpecial\$redirSubpage
string $redirSubpage
Name of subpage of redirect target.
Definition: SpecialRedirectToSpecial.php:34
SpecialRedirectToSpecial\__construct
__construct( $name, $redirName, $redirSubpage=false, $allowedRedirectParams=[], $addedRedirectParams=[])
Stable to call.
Definition: SpecialRedirectToSpecial.php:45
SpecialRedirectToSpecial\getRedirect
getRedirect( $subpage)
Definition: SpecialRedirectToSpecial.php:60
SpecialRedirectToSpecial
Stable to extend.
Definition: SpecialRedirectToSpecial.php:29
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:92
RedirectSpecialPage
Shortcut to construct a special page alias.
Definition: RedirectSpecialPage.php:31
SpecialRedirectToSpecial\$redirName
string $redirName
Name of redirect target.
Definition: SpecialRedirectToSpecial.php:31