ThemeExtension
extends BaseExtension
in package
Provides extensions to the Plates engine, adding helper methods for themes
Tags
Table of Contents
- $dbTheme : Theme
- $theme : Theme
- __construct() : mixed
- Creates a new ThemeExtension class
- asset() : ThemeAsset|null
- config() : bool|string|null
- Gets a configuration value from the database, if the value is not set in the database, the default value will be set
- register() : void
- Registers the helper method with the plates engine
- scripts() : string
- Returns script tags for all configured scripts
- styles() : string
- Returns link tags for all configured stylesheets
Properties
$dbTheme
private
Theme
$dbTheme
The currently active database theme
Tags
$theme
private
Theme
$theme
The currently active theming theme
Tags
Methods
__construct()
Creates a new ThemeExtension class
public
__construct(Theme $theme, Theme $dbTheme) : mixed
Parameters
Tags
Return values
mixed —asset()
public
asset(string $name) : ThemeAsset|null
Parameters
- $name : string
Tags
Return values
ThemeAsset|null —config()
Gets a configuration value from the database, if the value is not set in the database, the default value will be set
public
config(string $group, string $field) : bool|string|null
Parameters
- $group : string
-
The group the configuration value belongs to
- $field : string
-
The field the configuration value belongs to
Tags
Return values
bool|string|null —register()
Registers the helper method with the plates engine
public
register(Engine $engine) : void
Parameters
- $engine : Engine
Tags
Return values
void —scripts()
Returns script tags for all configured scripts
public
scripts() : string
Tags
Return values
string —styles()
Returns link tags for all configured stylesheets
public
styles() : string