DashboardViewModelFields
Single seam for deriving dashboard-primitive identity fields (title, description, brand, items, ...) from mounted state meta and request props. Both {@see \Milpa\Live\Rendering\DashboardHtmlRenderer} and {@see \Milpa\Live\Rendering\TuiComponentRenderer} resolve these fields through here instead of re-deriving their own fallback chain, so the two render targets cannot silently disagree on precedence again -- state meta (set at mount time, and possibly mutated since) always wins over the request's current props, which wins over the family default.
DashboardViewModelFields::string()
public static function string(array $meta, array $props, string $key, string $default = ''): stringResolves a string field, preferring `$meta[$key]`, then `$props[$key]`, then `$default`.
Parameters
| Name | Type | Description |
|---|---|---|
| $meta | array<string, mixed> | |
| $props | array<string, mixed> | |
| $key | string | |
| $default | string |
DashboardViewModelFields::bool()
public static function bool(array $meta, array $props, string $key, bool $default = false): boolResolves a boolean field, preferring `$meta[$key]`, then `$props[$key]`, then `$default`.
Parameters
| Name | Type | Description |
|---|---|---|
| $meta | array<string, mixed> | |
| $props | array<string, mixed> | |
| $key | string | |
| $default | bool |
DashboardViewModelFields::list()
public static function list(array $meta, array $props, string $key): arrayResolves a list-of-records field, preferring `$meta[$key]`, then `$props[$key]`, defaulting to an empty list. Non-array entries within the resolved value are silently dropped rather than causing an error, since list items are expected to each be an associative array (e.g. a sidebar item, an alert entry).
Parameters
| Name | Type | Description |
|---|---|---|
| $meta | array<string, mixed> | |
| $props | array<string, mixed> | |
| $key | string |