Context
What the $ctx array contains
| Key | Type | Use |
|---|---|---|
title, subtitle | string | Page title and subtitle. |
active | string | Active navigation item. |
actions | string | HTML actions block pre-rendered by the core. |
flash | array|null | Optional flash message. |
user | array|null | Current user. |
theme_id | string | Active theme identifier. |
app_name, app_logo_letter | string | Instance identity. |
nav | array | Navigation already filtered by permissions. |
Inside an overridden page, you may also receive page_id and data. For the dashboard, data currently contains the summary loaded by the core.
Best practices
Composing a theme without making it fragile
- Prefer a part override over a full slot copy when possible.
- Use
rui_default_slot()to wrap native rendering when that is enough. - Escape dynamic output with
rui_escape()or existing helpers. - Avoid business logic and direct access to internal layers from theme templates.
Treat internal classes as core implementation details, not as a stable API for themes. The safest way to avoid regressions is to go through the context and template tags.