interacts_with_page
trait interacts_with_page
| internal |
Trait handling Moodle $PAGE, Context, Output and Layouts.
Properties
| protected null|context | $context | ||
| protected string | $page_layout | ||
| protected string | $page_title | ||
| protected string | $page_heading | ||
| protected moodle_url|string|null | $page_url | ||
| protected array | $page_navbar | ||
| protected string | $admin_section | ||
| mixed | $course | ||
| mixed | $cm |
Methods
Set the context for the controller.
Get the resolved context (defaults to system).
Set the page URL.
Set Moodle page layout.
Set page title.
Set page heading.
Add an item to the page navbar trail.
Helper to set URL from route name.
Resolves the context if null, based on course/cm properties.
Apply all settings to the global $PAGE object.
Get the Moodle page URL, resolving defaults when needed.
Details
at line 58
void
set_context(context|null $context = null)
Set the context for the controller.
at line 66
context
get_context()
Get the resolved context (defaults to system).
at line 74
void
set_page_url(moodle_url|string $url)
Set the page URL.
at line 82
void
set_page_layout(string $layout)
Set Moodle page layout.
at line 90
void
set_page_title(string $title)
Set page title.
at line 98
void
set_page_heading(string $heading)
Set page heading.
at line 106
void
add_page_navbar(array|string $item)
Add an item to the page navbar trail.
at line 114
void
set_url_from_route(string $route, array $parameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
Helper to set URL from route name.
at line 129
protected void
resolve_context()
Resolves the context if null, based on course/cm properties.
at line 147
protected void
setup_moodle_page()
Apply all settings to the global $PAGE object.
at line 179
protected moodle_url
get_page_url()
Get the Moodle page URL, resolving defaults when needed.