ThemeHelper
in package
Table of Contents
Methods
- cssVar() : string
- Generate CSS variable for theme
- current() : string
- Get current theme machine name
- detect() : string
- Detect current active theme
- extensionSupportsTheme() : bool
- Check if extension supports theme
- getAllThemes() : array<string|int, mixed>
- Get all supported themes
- getCssFile() : string|null
- Get CSS file for theme
- getCssPrefix() : string
- Get CSS prefix for current theme
- getInfo() : array<string|int, mixed>
- Get theme info
- getTemplatePath() : string
- Get template path for theme
- isBootstrap5() : bool
- Check if theme is Bootstrap 5
- registerTheme() : void
- Register a new theme
- reset() : void
- Reset theme detection
- setTheme() : void
- Set current theme (for testing)
Methods
cssVar()
Generate CSS variable for theme
public
static cssVar(string $name[, string|null $fallback = null ]) : string
Parameters
- $name : string
- $fallback : string|null = null
Return values
stringcurrent()
Get current theme machine name
public
static current() : string
Return values
stringdetect()
Detect current active theme
public
static detect() : string
Return values
stringextensionSupportsTheme()
Check if extension supports theme
public
static extensionSupportsTheme(array<string|int, mixed> $manifest[, string|null $theme = null ]) : bool
Parameters
- $manifest : array<string|int, mixed>
- $theme : string|null = null
Return values
boolgetAllThemes()
Get all supported themes
public
static getAllThemes() : array<string|int, mixed>
Return values
array<string|int, mixed>getCssFile()
Get CSS file for theme
public
static getCssFile(string $extensionPath[, string|null $theme = null ]) : string|null
Parameters
- $extensionPath : string
- $theme : string|null = null
Return values
string|nullgetCssPrefix()
Get CSS prefix for current theme
public
static getCssPrefix([string|null $theme = null ]) : string
Parameters
- $theme : string|null = null
Return values
stringgetInfo()
Get theme info
public
static getInfo([string|null $theme = null ]) : array<string|int, mixed>
Parameters
- $theme : string|null = null
Return values
array<string|int, mixed>getTemplatePath()
Get template path for theme
public
static getTemplatePath(string $extensionPath, string $template[, string|null $theme = null ]) : string
Parameters
- $extensionPath : string
- $template : string
- $theme : string|null = null
Return values
stringisBootstrap5()
Check if theme is Bootstrap 5
public
static isBootstrap5([string|null $theme = null ]) : bool
Parameters
- $theme : string|null = null
Return values
boolregisterTheme()
Register a new theme
public
static registerTheme(string $machineName, array<string|int, mixed> $info) : void
Parameters
- $machineName : string
- $info : array<string|int, mixed>
reset()
Reset theme detection
public
static reset() : void
setTheme()
Set current theme (for testing)
public
static setTheme(string $theme) : void
Parameters
- $theme : string