Theme
in package
implements
ExtensionInterface
Themes contain all information about the cache state and several helpers for themes
Tags
Interfaces, Classes, Traits and Enums
- ExtensionInterface
Table of Contents
- BASE_CACHE_PATH = __DIR__ . '/../../public' . self::BASE_PUBLIC_PATH
- BASE_PUBLIC_PATH = '/themes/'
- ERROR_BEHAVIOR_ERROR_PAGE = 'errorpage'
- ERROR_BEHAVIOR_HOMEPAGE = 'homepage'
- $configuration : array<string, mixed>
- $dbTheme : Theme
- $scssCompiler : Compiler
- __construct() : mixed
- Theme constructor.
- compileAssetCache() : void
- Compiles the asset cache of the given theme
- compileScriptCache() : void
- Compiles the script cache of the given theme
- compileStyleCache() : void
- Compiles the style cache of the given theme
- getConfigurationStructure() : array<string, mixed>
- Gets the configuration structure from the theme.php
- getConfigurationValues() : array<string, mixed>
- Gets the configuration values
- getErrorBehavior() : string
- Gets the desired error behavior
- getPreviewImagePath() : string
- Gets the path to the preview image
- getStyleVariables() : array<string|int, string>
- Gets all style variables from the theme configuration
- register() : void
- Registers the theme in the engine
- scssJinyaAsset() : array<string|int, mixed>|mixed|Number
- Includes an asset into SCSS
- clearAssetCache() : void
- Clears the asset cache
- clearScriptCache() : void
- Clears the script cache
- clearStyleCache() : void
- Clears the style cache
- getAssetCache() : array<string|int, string>
- Gets the asset cache
- getScriptCache() : array<string|int, string>
- Gets the script cache
- getStyleCache() : array<string|int, string>
- Gets the style cache
- parseThemePhp() : void
- Parses the theme.php file
Constants
BASE_CACHE_PATH
public
string
BASE_CACHE_PATH
= __DIR__ . '/../../public' . self::BASE_PUBLIC_PATH
The default cache path for themes
Tags
BASE_PUBLIC_PATH
public
string
BASE_PUBLIC_PATH
= '/themes/'
The base public path for themes
Tags
ERROR_BEHAVIOR_ERROR_PAGE
public
string
ERROR_BEHAVIOR_ERROR_PAGE
= 'errorpage'
Use this in your theme.php if you want to show an error page if there is any error
Tags
ERROR_BEHAVIOR_HOMEPAGE
public
string
ERROR_BEHAVIOR_HOMEPAGE
= 'homepage'
Use this in your theme.php if you want to redirect to the homepage if there is any error
Tags
Properties
$configuration
private
array<string, mixed>
$configuration
The configuration of the theme
Tags
$dbTheme
private
Theme
$dbTheme
The theme from the database
Tags
$scssCompiler
private
Compiler
$scssCompiler
The SCSS compiler used to compile the themes
Tags
Methods
__construct()
Theme constructor.
public
__construct(Theme $dbTheme) : mixed
Parameters
- $dbTheme : Theme
Tags
Return values
mixed —compileAssetCache()
Compiles the asset cache of the given theme
public
compileAssetCache() : void
Tags
Return values
void —compileScriptCache()
Compiles the script cache of the given theme
public
compileScriptCache() : void
Tags
Return values
void —compileStyleCache()
Compiles the style cache of the given theme
public
compileStyleCache() : void
Tags
Return values
void —getConfigurationStructure()
Gets the configuration structure from the theme.php
public
getConfigurationStructure() : array<string, mixed>
Tags
Return values
array<string, mixed> —getConfigurationValues()
Gets the configuration values
public
getConfigurationValues() : array<string, mixed>
Tags
Return values
array<string, mixed> —getErrorBehavior()
Gets the desired error behavior
public
getErrorBehavior() : string
Tags
Return values
string —getPreviewImagePath()
Gets the path to the preview image
public
getPreviewImagePath() : string
Tags
Return values
string —getStyleVariables()
Gets all style variables from the theme configuration
public
getStyleVariables() : array<string|int, string>
Tags
Return values
array<string|int, string> —register()
Registers the theme in the engine
public
register(Engine $engine) : void
Parameters
- $engine : Engine
Tags
Return values
void —scssJinyaAsset()
Includes an asset into SCSS
public
scssJinyaAsset(array<string|int, mixed> $args) : array<string|int, mixed>|mixed|Number
Parameters
- $args : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>|mixed|Number —clearAssetCache()
Clears the asset cache
private
clearAssetCache() : void
Tags
Return values
void —clearScriptCache()
Clears the script cache
private
clearScriptCache() : void
Tags
Return values
void —clearStyleCache()
Clears the style cache
private
clearStyleCache() : void
Tags
Return values
void —getAssetCache()
Gets the asset cache
private
getAssetCache() : array<string|int, string>
Tags
Return values
array<string|int, string> —getScriptCache()
Gets the script cache
private
getScriptCache() : array<string|int, string>
Tags
Return values
array<string|int, string> —getStyleCache()
Gets the style cache
private
getStyleCache() : array<string|int, string>
Tags
Return values
array<string|int, string> —parseThemePhp()
Parses the theme.php file
private
parseThemePhp() : void