Documentation

Theme extends Plugin
in package

Class Theme

Table of Contents

Properties

$features  : array<string|int, mixed>
$name  : string
$active  : bool
$blueprint  : Blueprint|null
$config  : Config|null
$grav  : Grav
$loader  : ClassLoader|null

Methods

__construct()  : mixed
Constructor.
__debugInfo()  : array<string|int, mixed>
config()  : array<string|int, mixed>
Get configuration of the plugin.
getBlueprint()  : Blueprint
Simpler getter for the plugin blueprint
getSubscribedEvents()  : array<string|int, mixed>
By default assign all methods as listeners using the default priority.
inheritedConfigOption()  : mixed
isAdmin()  : bool
Determine if plugin is running under the admin
isCli()  : bool
Determine if plugin is running under the CLI
offsetExists()  : bool
Whether or not an offset exists.
offsetGet()  : mixed
Returns the value at specified offset.
offsetSet()  : mixed
Assigns a value to the specified offset.
offsetUnset()  : mixed
Unsets an offset.
saveConfig()  : bool
Persists to disk the theme parameters currently stored in the Grav Config object
setConfig()  : $this
disable()  : void
enable()  : void
isPluginActiveAdmin()  : bool
Determine if this route is in Admin and active for the plugin
loadBlueprint()  : void
Load blueprints.
mergeConfig()  : Data
Merge global and page configurations.
parseLinks()  : string
This function will search a string for markdown links in a specific format. The link value can be optionally compared against via the $internal_regex and operated on by the callback $function provided.

Properties

$features

public array<string|int, mixed> $features = []

$active

protected bool $active = true

$loader

protected ClassLoader|null $loader

Methods

__construct()

Constructor.

public __construct(Grav $grav, Config $config, string $name) : mixed
Parameters
$grav : Grav
$config : Config
$name : string

__debugInfo()

public __debugInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

config()

Get configuration of the plugin.

public config() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSubscribedEvents()

By default assign all methods as listeners using the default priority.

public static getSubscribedEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>

inheritedConfigOption()

public static inheritedConfigOption(string $plugin, string $var[, PageInterface $page = null ][, mixed $default = null ]) : mixed
Parameters
$plugin : string
$var : string
$page : PageInterface = null
$default : mixed = null

isAdmin()

Determine if plugin is running under the admin

public isAdmin() : bool
Return values
bool

isCli()

Determine if plugin is running under the CLI

public isCli() : bool
Return values
bool

offsetExists()

Whether or not an offset exists.

public offsetExists(string $offset) : bool
Parameters
$offset : string

An offset to check for.

Attributes
#[ReturnTypeWillChange]
Return values
bool

Returns TRUE on success or FALSE on failure.

offsetGet()

Returns the value at specified offset.

public offsetGet(string $offset) : mixed
Parameters
$offset : string

The offset to retrieve.

Attributes
#[ReturnTypeWillChange]
Return values
mixed

Can return all value types.

offsetSet()

Assigns a value to the specified offset.

public offsetSet(string $offset, mixed $value) : mixed
Parameters
$offset : string

The offset to assign the value to.

$value : mixed

The value to set.

Tags
throws
LogicException
Attributes
#[ReturnTypeWillChange]

offsetUnset()

Unsets an offset.

public offsetUnset(string $offset) : mixed
Parameters
$offset : string

The offset to unset.

Tags
throws
LogicException
Attributes
#[ReturnTypeWillChange]

saveConfig()

Persists to disk the theme parameters currently stored in the Grav Config object

public static saveConfig(string $name) : bool
Parameters
$name : string

The name of the theme whose config it should store.

Return values
bool

setConfig()

public setConfig(Config $config) : $this
Parameters
$config : Config
Return values
$this

disable()

protected disable(array<string|int, mixed> $events) : void
Parameters
$events : array<string|int, mixed>

enable()

protected enable(array<string|int, mixed> $events) : void
Parameters
$events : array<string|int, mixed>

isPluginActiveAdmin()

Determine if this route is in Admin and active for the plugin

protected isPluginActiveAdmin(string $plugin_route) : bool
Parameters
$plugin_route : string
Return values
bool

loadBlueprint()

Load blueprints.

protected loadBlueprint() : void

mergeConfig()

Merge global and page configurations.

protected mergeConfig(PageInterface $page[, mixed $deep = false ][, array<string|int, mixed> $params = [] ][, string $type = 'plugins' ]) : Data

WARNING: This method modifies page header!

Parameters
$page : PageInterface

The page to merge the configurations with the plugin settings.

$deep : mixed = false

false = shallow|true = recursive|merge = recursive+unique

$params : array<string|int, mixed> = []

Array of additional configuration options to merge with the plugin settings.

$type : string = 'plugins'

Is this 'plugins' or 'themes'

Return values
Data

This function will search a string for markdown links in a specific format. The link value can be optionally compared against via the $internal_regex and operated on by the callback $function provided.

protected parseLinks(string $content, callable $function[, string $internal_regex = '(.*)' ]) : string

format: plugin:myplugin_name

Parameters
$content : string

The string to perform operations upon

$function : callable

The anonymous callback function

$internal_regex : string = '(.*)'

Optional internal regex to extra data from

Return values
string

        
On this page

Search results