Themes
trait Themes
Constants
| protected DEFAULT_THEME |
The default theme name. |
| protected DEFAULT_THEMES |
The default theme registry. |
Properties
| static protected string | $theme | The name of the active theme. |
|
| static protected Prompt>, class-string<callable&object>>> | $themes | The available themes. |
Methods
Get or set the active theme.
Add a new theme.
Get the renderer for the current prompt.
Render the prompt using the active theme.
Reset theme state to defaults.
Details
at line 112
static string
theme(string|null $name = null)
Get or set the active theme.
Boot-only when setting. The active theme persists in a static property for the worker lifetime and applies to every subsequent prompt render.
at line 133
static void
addTheme(string $name, array $renderers)
Add a new theme.
Boot-only. Themes persist in a static property for the worker lifetime and are available to every subsequent prompt render.
at line 145
protected callable
getRenderer()
Get the renderer for the current prompt.
at line 155
protected string
renderTheme()
Render the prompt using the active theme.
at line 168
static void
resetTheme()
Reset theme state to defaults.
Boot or tests only. Clears worker-wide prompt theme configuration; concurrent prompts may render with different themes depending on timing.