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.
Uses 1
Constants and properties
| private | SCREENSHOTS = array ( 0 => 'png', 1 => 'gif', 2 => 'jpg', 3 => 'jpeg', 4 => 'webp', 5 => 'avif', ) | |
| prop | readonly string $root | Promoted from the constructor. |
| prop | readonly string $slug | Promoted from the constructor. |
| prop | readonly bool $exists | Promoted from the constructor. |
| prop | readonly array $headers | Promoted from the constructor. |
| prop | readonly string $template | Promoted from the constructor. |
Public
| new | __construct(string $root, string $slug, bool $exists, array $headers, string $template)# |
| ||||||
| static | read(string $root, string $slug, array $labels, ?Closure $reader = NULL): self# | A theme folder with its style.css headers.
| ||||||
| method | dir(): string# | The folder's path. | ||||||
| method | screenshot(): ?string# | The screenshot file name, or null when the theme has none. | ||||||
| static | isBlockTheme(array $dirs): bool# | Whether any of the folders ships a block template index.
| ||||||
| static | filePath(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. |
Nothing matches.