Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
ThemesManager Class Reference

Themes manager. More...

Static Public Member Functions

static getActiveTheme ()
 
static setActiveTheme (string $activeTheme)
 Sets the activeTheme.
 
static saveActiveTheme (string $theme)
 
static setActiveThemeFromTwig (string $activeTheme)
 Sets the activeTheme.
 
static getAvailableThemes ()
 Returns the names of available themes.
 
static getRefThemes ()
 Returns all referenced themes.
 
static isCustom (string $theme)
 Returns if a theme is a custom Theme (not in refThemes).
 
static getNotInstalledThemes ()
 Returns the not installed themes.
 
static onBeforeRender ($callback)
 Adds a listener before theme rendering.
 
static onAfterRender ($callback)
 Adds a listener after theme rendering.
 

Data Fields

const THEMES_FOLDER = 'themes'
 

Static Private Attributes

static $activeTheme
 
static $refThemes = ['bootstrap', 'foundation', 'semantic']
 

Detailed Description

Themes manager.

Ubiquity\themes$ThemesManager This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.1.1
Since
Ubiquity 2.1.0

Definition at line 22 of file ThemesManager.php.

Member Function Documentation

◆ getActiveTheme()

static getActiveTheme ( )
static

Definition at line 27 of file ThemesManager.php.

◆ getAvailableThemes()

static getAvailableThemes ( )
static

Returns the names of available themes.

Returns
string[]

Definition at line 68 of file ThemesManager.php.

◆ getNotInstalledThemes()

static getNotInstalledThemes ( )
static

Returns the not installed themes.

Returns
array

Definition at line 102 of file ThemesManager.php.

◆ getRefThemes()

static getRefThemes ( )
static

Returns all referenced themes.

Returns
string[]

Definition at line 83 of file ThemesManager.php.

◆ isCustom()

static isCustom ( string  $theme)
static

Returns if a theme is a custom Theme (not in refThemes).

Parameters
string$theme
Returns
boolean

Definition at line 93 of file ThemesManager.php.

◆ onAfterRender()

static onAfterRender (   $callback)
static

Adds a listener after theme rendering.

The callback function takes the following parameters: $render (the response string), $view (the view name), $pData (array of datas sent to the view)

Parameters
callable$callback

Definition at line 123 of file ThemesManager.php.

◆ onBeforeRender()

static onBeforeRender (   $callback)
static

Adds a listener before theme rendering.

The callback function takes the following parameters: $view (the view name), $pData (array of datas sent to the view)

Parameters
callable$callback

Definition at line 113 of file ThemesManager.php.

◆ saveActiveTheme()

static saveActiveTheme ( string  $theme)
static

Definition at line 47 of file ThemesManager.php.

◆ setActiveTheme()

static setActiveTheme ( string  $activeTheme)
static

Sets the activeTheme.

Parameters
string$activeTheme
Exceptions
ThemesException

Definition at line 37 of file ThemesManager.php.

◆ setActiveThemeFromTwig()

static setActiveThemeFromTwig ( string  $activeTheme)
static

Sets the activeTheme.

Parameters
string$activeTheme

Definition at line 59 of file ThemesManager.php.

Field Documentation

◆ $activeTheme

$activeTheme
staticprivate

Definition at line 24 of file ThemesManager.php.

◆ $refThemes

$refThemes = ['bootstrap', 'foundation', 'semantic']
staticprivate

Definition at line 25 of file ThemesManager.php.

◆ THEMES_FOLDER

const THEMES_FOLDER = 'themes'

Definition at line 23 of file ThemesManager.php.


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