-
Notifications
You must be signed in to change notification settings - Fork 7
RootBuild
Refaltor77 edited this page Mar 29, 2026
·
1 revision
Interface that all screen definitions must implement.
interface RootBuild
{
public function root(): Root;
public function getNamespace(): string;
public function getPathName(): string;
public function titleCondition(): string;
}| Method | Returns | Description |
|---|---|---|
root() |
Root |
Build and return the screen's Root |
getNamespace() |
string |
Unique namespace (used as filename) |
getPathName() |
string |
Output directory path |
titleCondition() |
string |
Title text that triggers visibility |
<?php
namespace refaltor\roots;
use refaltor\ui\builders\Root;
use refaltor\ui\builders\RootBuild;
class MyScreen implements RootBuild
{
public function root(): Root
{
$root = Root::create();
// Build your UI here...
return $root;
}
public function getNamespace(): string
{
return "my_screen"; // -> custom_ui/my_screen.json
}
public function getPathName(): string
{
return "./resources/pack_example/";
}
public function titleCondition(): string
{
return "MY_SCREEN_TITLE"; // Visible when #title_text matches
}
}Add to Entry.php:
public function startingService(): void {
$this->register(new MyScreen());
}For each registered RootBuild, RegisterHelper generates:
-
ui/_ui_defs.json— Addsui/custom_ui/my_screen.jsonto the registry -
ui/server_form.json— Adds title condition bindings -
ui/custom_ui/my_screen.json— The complete screen definition