MediaWiki Developer's Handbook/Special Pages

From Wikibooks, open books for an open world
Jump to navigation Jump to search

This will show you how to create a special page.

MySpecialPage.php[edit | edit source]

<?php

if (!defined("MEDIAWIKI")) {
 die("not a valid entry point!");
}

$wgExtensionCredits['specialpage'][] = array (
 'name' => 'My Special Page!',
 'author' => 'Me',
 'url' => 'http://en.wikibooks.org/',
 'description' => 'A cool special page',
 'version' => '1.2.3',
);

$wgAutoloadClasses['MySpecialPage'] = $dir . "MySpecialPage_body.php";
$wgSpecialPages['MySpecialPage'] = 'MySpecialPage.php';

[$wgSpecialPages['MySpecialPage'] = 'MySpecialPage.php'; 1]

This is the special page itself. It should say something like Hello! "Your lucky number is 3"! {{:MediaWiki Developer's HandbookHandbookHandboHandbookHandbookHand