// Define a new SpecialPage class class MySpecialPage extends SpecialPage { public function __construct() { parent::__construct( 'MySpecialPage' ); // Set the page name } public function execute( $sub ) { // Page content goes here } }
// Define a new SpecialPage class class MySpecialPage extends SpecialPage { public function __construct() { parent::__construct( 'MySpecialPage', 'sysop' ); // Set the page name and required user right } public function execute( $sub ) { // Page content goes here } }In this example, we create a new SpecialPage class called MySpecialPage. We use the constructor method to set the page name and require the "sysop" user right to access the page. We then define the execute method to handle the page content. Package library: MediaWiki.