ThemeResourceLoader
class ThemeResourceLoader implements Flushable
Handles finding templates from a stack of template manifest objects.
Methods
No description
No description
Given a theme identifier, determine the path from the root directory
Attempts to find possible candidate templates from a set of template names from modules, current theme directory and finally the application folder.
Resolve themed CSS path
Resolve themed javascript path
Resolve a themed resource
Resolve all themes to the list of root folders relative to site root
Flush any cached data
No description
No description
Details
at line 46
static ThemeResourceLoader
inst()
at line 56
static
set_instance(ThemeResourceLoader $instance)
Set instance
at line 61
__construct($base = null)
at line 72
addSet(string $set, ThemeList $manifest)
Add a new theme manifest for a given identifier. E.g. '$default'
at line 83
ThemeList
getSet(string $set)
Get a named theme set
at line 105
string
getPath(string $identifier)
Given a theme identifier, determine the path from the root directory
The mapping from $identifier to path follows these rules: - A simple theme name ('mytheme') which maps to the standard themes dir (/themes/mytheme) - A theme path with a leading slash ('/mymodule/themes/mytheme') which maps directly to that path. - or a vendored theme path. (vendor/mymodule:mytheme) which maps to the nested 'theme' within that module. ('/mymodule/themes/mytheme'). - A vendored module with no nested theme (vendor/mymodule) which maps to the root directory of that module. ('/mymodule').
at line 185
string
findTemplate(string|array $template, array $themes = null)
Attempts to find possible candidate templates from a set of template names from modules, current theme directory and finally the application folder.
The template names can be passed in as plain strings, or be in the format "type/name", where type is the type of template to search for (e.g. Includes, Layout).
The results of this method will be cached for future use.
at line 263
string
findThemedCSS(string $name, array $themes = null)
Resolve themed CSS path
at line 292
string
findThemedJavascript(string $name, array $themes = null)
Resolve themed javascript path
A javascript file in the current theme path name 'themename/javascript/$name.js' is first searched for, and it that doesn't exist and the module parameter is set then a javascript file with that name in the module is used.
at line 319
string
findThemedResource(string $resource, array $themes = null)
Resolve a themed resource
A themed resource and be any file that resides in a theme folder.
at line 346
array
getThemePaths(array $themes = null)
Resolve all themes to the list of root folders relative to site root
at line 369
static
flush()
Flush any cached data