class Keys (View source)

The Keys class provides all methods to search all kind of content variables (keys of the data array) used in templates.

Properties

static $reserved Array with reserved variable keys.

Methods

static array
filterColorKeys(array $keys)

Get color variable keys from an array of keys.

static array
filterSettingKeys(array $keys)

Get settings variable keys from an array of keys.

static array
filterTextKeys(array $keys)

Get text variable keys from an array of keys.

static array
inCurrentTemplate(Page $Page, Theme|null $Theme = null)

Find all variable keys in the currently used template and all included snippets (and ignore those keys in $this->reserved).

static array
inTemplate(string $file)

Find all variable keys in a template and all included snippets (and ignore those keys in $this->reserved).

static array
inTheme(Theme $Theme)

Find all variable keys in templates of a given theme.

static array
cleanUp(array $keys, array $mask = array())

Cleans up an array of keys. All reserved and duplicate keys get removed and the optional UI mask is applied.

Details

static array filterColorKeys(array $keys)

Get color variable keys from an array of keys.

Parameters

array $keys

Return Value

array The array with only text variables.

static array filterSettingKeys(array $keys)

Get settings variable keys from an array of keys.

Parameters

array $keys

Return Value

array The array with only settings variables.

static array filterTextKeys(array $keys)

Get text variable keys from an array of keys.

Parameters

array $keys

Return Value

array The array with only text variables.

static array inCurrentTemplate(Page $Page, Theme|null $Theme = null)

Find all variable keys in the currently used template and all included snippets (and ignore those keys in $this->reserved).

Parameters

Page $Page
Theme|null $Theme

Return Value

array Keys in the currently used template (without reserved keys)

static array inTemplate(string $file)

Find all variable keys in a template and all included snippets (and ignore those keys in $this->reserved).

Parameters

string $file

Return Value

array Keys in a given template (without reserved keys)

static array inTheme(Theme $Theme)

Find all variable keys in templates of a given theme.

Parameters

Theme $Theme

Return Value

array Keys in all templates of the given Theme (without reserved keys)

static private array cleanUp(array $keys, array $mask = array())

Cleans up an array of keys. All reserved and duplicate keys get removed and the optional UI mask is applied.

Parameters

array $keys
array $mask

Return Value

array The sorted and filtered keys array