API / Minn\Theme / Folder

Folder final readonly class

Minn\Theme\Folder · public/minn/src/Minn/Theme/Folder.php · 77 lines

A theme folder read from disk: its style.css headers, which folder its templates come from, its screenshot, whether it is a block theme.

Constants and properties

privateSCREENSHOTS = array ( 0 => 'png', 1 => 'gif', 2 => 'jpg', 3 => 'jpeg', 4 => 'webp', 5 => 'avif', )
propreadonly string $root

Promoted from the constructor.

propreadonly string $slug

Promoted from the constructor.

propreadonly bool $exists

Promoted from the constructor.

propreadonly array $headers

Promoted from the constructor.

propreadonly string $template

Promoted from the constructor.

Public

new__construct(string $root, string $slug, bool $exists, array $headers, string $template)#
$headersarray<string, string>keyed by the caller's labels
staticread(string $root, string $slug, array $labels, ?Closure $reader = NULL): self#

A theme folder with its style.css headers.

$labelsarray<string, string>key => the style.css header label
$readerClosure(string, array<string, string>): array<string, string>|nullthe header reader (the facade's, so header filters apply); the engine's own by default
methoddir(): string#

The folder's path.

methodscreenshot(): ?string#

The screenshot file name, or null when the theme has none.

staticisBlockTheme(array $dirs): bool#

Whether any of the folders ships a block template index.

$dirslist<string>the stylesheet and template directories
staticfilePath(string $stylesheetDir, string $templateDir, string $file): string#

The first of the stylesheet and template directories that holds the file, or the template directory's path.