Heratio Framework API Reference

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
string

current()

Get current theme machine name

public static current() : string
Return values
string

detect()

Detect current active theme

public static detect() : string
Return values
string

extensionSupportsTheme()

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
bool

getAllThemes()

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|null

getCssPrefix()

Get CSS prefix for current theme

public static getCssPrefix([string|null $theme = null ]) : string
Parameters
$theme : string|null = null
Return values
string

getInfo()

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
string

isBootstrap5()

Check if theme is Bootstrap 5

public static isBootstrap5([string|null $theme = null ]) : bool
Parameters
$theme : string|null = null
Return values
bool

registerTheme()

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

        
On this page

Search results