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 117
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 138
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 150
protected callable
getRenderer()
Get the renderer for the current prompt.
at line 165
protected string
renderTheme()
Render the prompt using the active theme.
at line 179
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.