Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
context_header Class Reference

Renderable for the main page header. More...

Inheritance diagram for context_header:
renderable templatable

Public Member Functions

 __construct ($heading=null, $headinglevel=1, $imagedata=null, $additionalbuttons=null, $prefix=null)
 Constructor.
 
 export_for_template (renderer_base $output)
 Export for template.
 

Public Attributes

array $additionalbuttons
 $additionalbuttons Additional buttons for the header e.g.
 
string $heading
 $heading Main heading.
 
int $headinglevel
 $headinglevel Main heading 'h' tag level.
 
string null $imagedata
 $imagedata HTML code for the picture in the page header.
 
string $prefix
 $prefix A string that is before the title.
 

Protected Member Functions

 format_button_images ()
 Adds an array element for a formatted image.
 

Detailed Description

Renderable for the main page header.

Since
2.9
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

context_header::__construct ( $heading = null,
$headinglevel = 1,
$imagedata = null,
$additionalbuttons = null,
$prefix = null )

Constructor.

Parameters
string$headingMain heading data.
int$headinglevelMain heading 'h' tag level.
string | null$imagedataHTML code for the picture in the page header.
string$additionalbuttonsButtons for the header e.g. Messaging button for the user header.
string$prefixText that precedes the heading.

Member Function Documentation

◆ export_for_template()

context_header::export_for_template ( renderer_base $output)

Export for template.

Parameters
renderer_base$outputRenderer.
Return values
array

Implements templatable.

Member Data Documentation

◆ $additionalbuttons

array context_header::$additionalbuttons

$additionalbuttons Additional buttons for the header e.g.

Messaging button for the user header. array elements - title => alternate text for the image, or if no image is available the button text. url => Link for the button to head to. Should be a moodle_url. image => location to the image, or name of the image in /pix/t/{image name}. linkattributes => additional attributes for the element. page => page object. Don't include if the image is an external image.


The documentation for this class was generated from the following file: