class trilha extends block

Constants

TEMPLATE

Properties

string $title
protected array<string,mixed> $content from  abstract_block
protected array<string,string> $attributes from  abstract_block

Methods

void
set_title()

Sets the title for the current object.

string
get_title()

Get the block title, lazily loading it if empty.

array
process_content()

Processes and gathers content information related to the user's "trilha" (trail) data.

array
get_content()

Retrieves all the content of the block with memoization.

void
set_attribute(string $key, string $value)

Sets an HTML attribute for the block wrapper.

string
render()

Renders the widget using the specified template and processed content.

string
get_attributes()

Gets the attributes string safely using Moodle's html_writer.

__construct()

No description

Details

at line 44
void set_title()

Sets the title for the current object.

This method assigns a predefined string value as the title for the object. It is used to define a consistent title representation for the instance.

Return Value

void

in abstract_block at line 73
string get_title()

Get the block title, lazily loading it if empty.

Return Value

string

at line 61
array process_content()

Processes and gathers content information related to the user's "trilha" (trail) data.

This method retrieves default "trilha" information, checks its validity and enabled status, and compiles user and "trilha" specific data into an array. If no valid "trilha" exists, an empty array is returned.

Return Value

array

Exceptions

coding_exception
Exception

in abstract_block at line 97
array get_content()

Retrieves all the content of the block with memoization.

Using a boolean flag ($processed) is safer than checking for empty array, as the content might legitimately be empty after processing.

Return Value

array

in abstract_block at line 113
void set_attribute(string $key, string $value)

Sets an HTML attribute for the block wrapper.

Parameters

string $key
string $value

Return Value

void

in abstract_block at line 123
string render()

Renders the widget using the specified template and processed content.

Return Value

string

Rendered HTML fragment

in abstract_block at line 153
protected string get_attributes()

Gets the attributes string safely using Moodle's html_writer.

This handles escaping and boolean attributes correctly.

Return Value

string

the attributes formatted for HTML

at line 33
__construct()

No description