MediaWiki  master
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 }
string $redirName
Name of redirect target.
string $redirSubpage
Name of subpage of redirect target.
__construct( $name, $redirName, $redirSubpage=false, $allowedRedirectParams=[], $addedRedirectParams=[])
Shortcut to construct a special page alias.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don&#39;t need a full Title object...
Definition: SpecialPage.php:83