class ThemeCollection (View source)

The theme collection system class.

Properties

private $composerInstalled An array of installed Composer packages.
private $themes The Theme objects array.

Methods

__construct()

The constructor.

getThemeByKey(string $key)

Get the theme object by the key in the themelist array corresponding to the AM_KEY_THEME variable.

array
getThemes()

Return the Theme objects array.

array
collectThemes(string|null $path = null)

Collect installed themes recursively.

array
getComposerInstalled()

Get installed Composer packages.

Details

__construct()

The constructor.

Theme getThemeByKey(string $key)

Get the theme object by the key in the themelist array corresponding to the AM_KEY_THEME variable.

Parameters

string $key

Return Value

Theme The requested theme object

array getThemes()

Return the Theme objects array.

Return Value

array The array of Theme objects

See also

Theme

private array collectThemes(string|null $path = null)

Collect installed themes recursively.

A theme must be located below the "themes" directory. It is possible to group themes in subdirectories, like "themes/theme" or "themes/subdir/theme".

To be a valid theme, a directory must contain a "theme.json" file and at least one ".php" file.

Parameters

string|null $path

Return Value

array An array containing all themes as objects.

private array getComposerInstalled()

Get installed Composer packages.

Return Value

array An associative array of installed Composer packages