Skip to content
docsv0.3.0

StateToNode

Turns a plain state array into a TUI node tree. Total over its input: every shape a state array can carry becomes a node. Nothing is dropped for being an inconvenient shape — that decision is data loss, not formatting. It decides structure, never words. The two headers the key/value table needs are the caller's; everything else is derived from the data or left to the renderer's own defaults.

StateToNode::__construct()

public function __construct(string $fieldHeader = 'Field', string $valueHeader = 'Value'):

Parameters

Parameters of __construct()
NameTypeDescription
$fieldHeaderstring
$valueHeaderstring

StateToNode::map()

public function map(string $title, array $state): Milpa\Live\ValueObjects\Tui\TuiNode

Maps one section's state to a node tree.

Parameters

Parameters of map()
NameTypeDescription
$titlestring
$statearray<string, mixed>