Factory class to create Skin objects.
More...
|
| getSkinNames () |
| Returns an associative array of: skin name => human readable name.
|
|
| makeSkin ( $name) |
| Create a given Skin using the registered callback for $name.
|
|
| register ( $name, $displayName, $callback) |
| Register a new Skin factory function.
|
|
|
array | $displayNames = [] |
| Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available.
|
|
array | $factoryFunctions = [] |
| Map of name => callback.
|
|
Factory class to create Skin objects.
- Since
- 1.24
Definition at line 31 of file SkinFactory.php.
◆ getDefaultInstance()
static SkinFactory::getDefaultInstance |
( |
| ) |
|
|
static |
◆ getSkinNames()
SkinFactory::getSkinNames |
( |
| ) |
|
Returns an associative array of: skin name => human readable name.
- Returns
- array
Definition at line 81 of file SkinFactory.php.
◆ makeSkin()
SkinFactory::makeSkin |
( |
| $name | ) |
|
Create a given Skin using the registered callback for $name.
- Parameters
-
string | $name | Name of the skin you want |
- Exceptions
-
SkinException | If a factory function isn't registered for $name |
UnexpectedValueException | If the factory function returns a non-Skin object |
- Returns
- Skin
Definition at line 92 of file SkinFactory.php.
References $skin.
◆ register()
SkinFactory::register |
( |
| $name, |
|
|
| $displayName, |
|
|
| $callback ) |
Register a new Skin factory function.
Will override if it's already registered.
- Parameters
-
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 |
- Exceptions
-
InvalidArgumentException | If an invalid callback is provided |
Definition at line 67 of file SkinFactory.php.
References $name.
◆ $displayNames
array SkinFactory::$displayNames = [] |
|
private |
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available.
Definition at line 44 of file SkinFactory.php.
◆ $factoryFunctions
array SkinFactory::$factoryFunctions = [] |
|
private |
The documentation for this class was generated from the following file: