BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
SkinFactory Class Reference

Public Member Functions

 register ($name, $displayName, $callback)
 
 getSkinNames ()
 
 makeSkin ($name)
 

Static Public Member Functions

static getDefaultInstance ()
 

Detailed Description

Factory class to create Skin objects

Since
1.24

Member Function Documentation

static SkinFactory::getDefaultInstance ( )
static
Deprecated:
in 1.27
Returns
SkinFactory
SkinFactory::getSkinNames ( )

Returns an associative array of: skin name => human readable name

Returns
array
SkinFactory::makeSkin (   $name)

Create a given Skin using the registered callback for $name.

Parameters
string$nameName of the skin you want
Exceptions
SkinExceptionIf a factory function isn't registered for $name
UnexpectedValueExceptionIf the factory function returns a non-Skin object
Returns
Skin
SkinFactory::register (   $name,
  $displayName,
  $callback 
)

Register a new Skin factory function.

Will override if it's already registered.

Parameters
string$nameInternal skin name. Should be all-lowercase (technically doesn't have to be, but doing so would change the case of i18n message keys).
string$displayNameFor 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$callbackCallback that takes the skin name as an argument
Exceptions
InvalidArgumentExceptionIf an invalid callback is provided

The documentation for this class was generated from the following file: