interface block_interface

Contract for renderable UI blocks within the framework.

Implementations prepare data for templates and expose helpers for rendering and HTML attributes used by block drivers.

Methods

void
set_title()

Compute and store the block title.

string
get_title()

Returns the human-readable title of the block.

array
process_content()

Main computation function.

array
get_content()

Returns the processed block data, with memoization.

void
set_attribute(string $key, string $value)

Defines an HTML attribute for the block output wrapper.

string
render()

Render the block using the associated widget + template system.

Details

at line 29
void set_title()

Compute and store the block title.

Return Value

void

at line 37
string get_title()

Returns the human-readable title of the block.

Should call set_title() lazily if not already set.

Return Value

string

at line 45
array process_content()

Main computation function.

Should return all data needed by the template.

Return Value

array

at line 52
array get_content()

Returns the processed block data, with memoization.

Return Value

array

at line 60
void set_attribute(string $key, string $value)

Defines an HTML attribute for the block output wrapper.

Parameters

string $key
string $value

Return Value

void

at line 67
string render()

Render the block using the associated widget + template system.

Return Value

string

Rendered HTML fragment