Application
Reference for the Application module: build the shell of a web application from a themed root, with a menu, page titles, routes, and navigation buttons and links.
This page is a pure reference. For how the framework fits together, see the Guide.
ApplicationUi- the themed application root, its content area, intro screen, theme and routes.ApplicationButtonUi- button and link components that navigate to a path.ApplicationMenuUi- the application menu and its navigation links.ApplicationPageUi- page level components such as the page title.
ApplicationUi
Core application UI components. Render the themed application root, its main content area and intro screen, apply a theme to a block of content, and register routes for the application.
Content
ApplicationUi::Content(callable $content): void
Render the main content area, showing status messages above the given content.
| Name | Type | Description |
|---|---|---|
$content | callable | A callback that outputs the content of the area. |
Returns void
Intro
ApplicationUi::Intro(int $durationMs, callable $content): void
Render an intro screen that overlays the given content for a duration.
| Name | Type | Description |
|---|---|---|
$durationMs | int | How long the intro screen is shown, in milliseconds. |
$content | callable | A callback that outputs the intro content. |
Returns void
Render
ApplicationUi::Render(UiThemeData $theme, callable $children): void
Render the application root: the html and body document, the resolved theme, the title from config, and the given children.
| Name | Type | Description |
|---|---|---|
$theme | UiThemeData | The theme, with its variants, applied to the application. |
$children | callable | A callback that outputs the body of the application. |
Returns void
Route
ApplicationUi::Route(string $path, callable|string $pageUiCallback): void
Register a route for the application. An empty or slash path becomes the index route; any other path is registered as a file route.
| Name | Type | Description |
|---|---|---|
$path | string | The path to register the route at. |
$pageUiCallback | callable|string | A callback, or a callable name, that renders the page. |
Returns void
Theme
ApplicationUi::Theme(UiThemeVariantData $theme, callable $children): void
Apply a theme variant to a block of application content, rendering the children within it.
| Name | Type | Description |
|---|---|---|
$theme | UiThemeVariantData | The theme variant to apply. |
$children | callable | A callback that outputs the themed content. |
Returns void
ApplicationButtonUi
Button components for application navigation. Render a button styled link, or a plain link, that navigates to a path.
Link
ApplicationButtonUi::Link(string $goToPath, callable $content): void
Render a button styled link that navigates to a path.
| Name | Type | Description |
|---|---|---|
$goToPath | string | The path the button navigates to. |
$content | callable | A callback that outputs the button label. |
Returns void
LinkButton
ApplicationButtonUi::LinkButton(string $goToPath, callable $content): void
Render a plain, non button styled link that navigates to a path.
| Name | Type | Description |
|---|---|---|
$goToPath | string | The path the link navigates to. |
$content | callable | A callback that outputs the link content. |
Returns void
ApplicationMenuUi
Menu components for application navigation. Render the application menu wrapper, and menu links that navigate to a path.
Link
ApplicationMenuUi::Link(string $goToPath, callable $content): void
Render a menu link that navigates to a path.
| Name | Type | Description |
|---|---|---|
$goToPath | string | The path the menu link navigates to. |
$content | callable | A callback that outputs the menu link content. |
Returns void
Render
ApplicationMenuUi::Render(UiThemeVariantData $menuTheme, callable $children): void
Render the application menu, wrapping the given children in the menu navigation.
| Name | Type | Description |
|---|---|---|
$menuTheme | UiThemeVariantData | The theme variant applied to the menu. |
$children | callable | A callback that outputs the menu links. |
Returns void
ApplicationPageUi
Page components for applications. Render page level structure such as the page title.
Title
ApplicationPageUi::Title(string $title, ?callable $optionalLeftContent = null): void
Render a page title, with optional content shown to its left.
| Name | Type | Description |
|---|---|---|
$title | string | The page title text. |
$optionalLeftContent | ?callable | A callback that outputs content to the left of the title, or null for none. |
Returns void