MIDDAG for Moodle

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.

Table of Contents

Methods

get_content()  : array<string, mixed>
Returns the processed block data, with memoization.
get_title()  : string
Returns the human-readable title of the block.
process_content()  : array<string, mixed>
Main computation function.
render()  : string
Render the block using the associated widget + template system.
set_attribute()  : void
Defines an HTML attribute for the block output wrapper.
set_title()  : void
Compute and store the block title.

Methods

get_content()

Returns the processed block data, with memoization.

public get_content() : array<string, mixed>
Return values
array<string, mixed>

get_title()

Returns the human-readable title of the block.

public get_title() : string

Should call set_title() lazily if not already set.

Return values
string

process_content()

Main computation function.

public process_content() : array<string, mixed>

Should return all data needed by the template.

Return values
array<string, mixed>

render()

Render the block using the associated widget + template system.

public render() : string
Return values
string

Rendered HTML fragment

set_attribute()

Defines an HTML attribute for the block output wrapper.

public set_attribute(string $key, string $value) : void
Parameters
$key : string
$value : string

set_title()

Compute and store the block title.

public set_title() : void

        
On this page

Search results