MediaWiki
1.34.0
|
Factory class to create Skin objects. More...
Public Member Functions | |
getSkinNames () | |
Returns an associative array of: skin name => human readable name. More... | |
makeSkin ( $name) | |
Create a given Skin using the registered callback for $name. More... | |
register ( $name, $displayName, $callback) | |
Register a new Skin factory function. More... | |
Private Attributes | |
array | $displayNames = [] |
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available. More... | |
array | $factoryFunctions = [] |
Map of name => callback. More... | |
SkinFactory::getSkinNames | ( | ) |
Returns an associative array of: skin name => human readable name.
Definition at line 71 of file SkinFactory.php.
References $displayNames.
SkinFactory::makeSkin | ( | $name | ) |
Create a given Skin using the registered callback for $name.
string | $name | Name of the skin you want |
SkinException | If a factory function isn't registered for $name |
UnexpectedValueException | If the factory function returns a non-Skin object |
Definition at line 82 of file SkinFactory.php.
SkinFactory::register | ( | $name, | |
$displayName, | |||
$callback | |||
) |
Register a new Skin factory function.
Will override if it's already registered.
string | $name | Internal skin name. Should be all-lowercase (technically doesn't have to be, but doing so would change the case of i18n message keys). |
string | $displayName | For backwards-compatibility with old skin loading system. This is the text used as skin's human-readable name when the 'skinname-<skin>' message is not available. It should be the same as the skin name provided in $wgExtensionCredits. |
callable | $callback | Callback that takes the skin name as an argument |
InvalidArgumentException | If an invalid callback is provided |
Definition at line 57 of file SkinFactory.php.
|
private |
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available.
Definition at line 42 of file SkinFactory.php.
Referenced by getSkinNames().
|
private |
Map of name => callback.
Definition at line 35 of file SkinFactory.php.