Final Class Yiisoft\Form\Theme\ThemeContainer
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getTheme() | Yiisoft\ |
|
| initialize() | Yiisoft\ |
Method Details
| public static ?\ | ||
| $name | ?string | |
public static function getTheme(?string $name = null): ?Theme
{
$name ??= self::$defaultConfig;
if ($name === null) {
return null;
}
if (!array_key_exists($name, self::$themes)) {
/** @psalm-suppress MixedArgument */
self::$themes[$name] = array_key_exists($name, self::$configs)
? new Theme(...self::$configs[$name])
: null;
}
return self::$themes[$name];
}
| public static void initialize ( array | ||
| $configs | array |
Array of configurations with {@see \
]
|
| $defaultConfig | string|null |
Configuration name that will be used for create fields by default. |
public static function initialize(array $configs = [], ?string $defaultConfig = null): void
{
self::$configs = $configs;
self::$defaultConfig = $defaultConfig;
self::$themes = [];
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.