Manual:SpecialPage.php
Appearance
MediaWiki file: SpecialPage.php | |
---|---|
Location: | includes/specialpage/ |
Source code: | master • 1.42.4 • 1.41.5 • 1.39.11 |
Classes: | MediaWiki\SpecialPage\SpecialPage |
Description
[edit]The file SpecialPage.php contains the SpecialPage
class, which includes static functions for handling special pages and lists thereof.
This class implements the MessageLocalizer interface.
To add a special page in an extension, add to $wgSpecialPages either
- an object instance, or
- an array containing the name and constructor parameters (preferred for performance reasons)
The object instantiated must be either an instance of SpecialPage or a sub-class thereof.
It must have an execute()
method, which sends the HTML for the special page to $wgOut .
The parent class has an execute()
method which distributes the call to the historical global functions.
Additionally, execute()
also checks if the user has the necessary access privileges and bails out if not.
- To add a core special page, use the similar static list in
SpecialPageFactory::$coreList
. - To remove a core static special page at runtime, use a initList hook.