Domovoy API

BlockRegistry
in package

FinalYes

Immutable registry of named content blocks for layout composition.

Used to implement layout inheritance: a parent template defines block slots, and child templates override them by setting blocks in the registry. Each set() call returns a new instance (immutable).

Table of Contents

Properties

$blocks  : array<string|int, mixed>

Methods

create()  : self
get()  : Node
getOrDefault()  : Node
has()  : bool
set()  : self
__construct()  : mixed

Properties

$blocks read-only

private array<string|int, mixed> $blocks = []

Methods

get()

public get(string $name) : Node
Parameters
$name : string
Return values
Node

getOrDefault()

public getOrDefault(string $name, Node $default) : Node
Parameters
$name : string
$default : Node
Return values
Node

has()

public has(string $name) : bool
Parameters
$name : string
Return values
bool

set()

public set(string $name, Node $content) : self
Parameters
$name : string
$content : Node
Return values
self

__construct()

private __construct([array<string, Node$blocks = [] ]) : mixed
Parameters
$blocks : array<string, Node> = []

        
On this page

Search results