Domovoy API

FutureNode
in package

Read onlyYes
FinalYes

Two-step curried node factory: first call sets attributes, second call sets children.

Generated element functions (e.g. div(), input()) return a FutureNode. Invoking it with children produces the final Node:

div(id: 'main', className: 'container')('Hello', $child)
// 1st call: attributes → FutureNode
// 2nd call: children  → DivNode

Void elements (br, img, ...) return a Node directly, skipping this step.

Tags
template

Table of Contents

Properties

$attributes  : array<int, mixed>
$caller  : ReflectionFunction
$nodeClass  : ReflectionClass<string|int, NodeType>

Methods

__construct()  : mixed
__invoke()  : NodeType
fromCall()  : SomeNode>
buildAttributes()  : NodeAttributes

Properties

$attributes

public array<int, mixed> $attributes

$nodeClass

public ReflectionClass<string|int, NodeType> $nodeClass

Methods

__construct()

public __construct(ReflectionFunction $caller, array<string|int, mixed> $attributes, ReflectionClass $nodeClass) : mixed
Parameters
$caller : ReflectionFunction
$attributes : array<string|int, mixed>
$nodeClass : ReflectionClass

__invoke()

public __invoke(Node|int|string|float|Closure ...$children) : NodeType
Parameters
$children : Node|int|string|float|Closure
Return values
NodeType

fromCall()

public static fromCall(non-empty-string $caller, array<int, mixed> $attributes, SomeNode> $nodeClass) : SomeNode>
Parameters
$caller : non-empty-string
$attributes : array<int, mixed>
$nodeClass : SomeNode>
Tags
template
Return values
SomeNode>

        
On this page

Search results