Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core\output\action_menu\link Class Reference
Inheritance diagram for core\output\action_menu\link:
core\output\action_link core\output\renderable core\output\renderable core\output\action_menu\link_primary core\output\action_menu\link_secondary

Public Member Functions

 __construct (moodle_url $url, ?pix_icon $icon, $text, $primary=true, array $attributes=[])
 Constructs the object.
 
 add_action (component_action $action)
 Add action to the link.
 
 add_class ($class)
 Adds a CSS class to this action link object.
 
 export_for_template (renderer_base $output)
 Export for template.
 
 get_icon_html ()
 Return the rendered HTML for the icon.
 
 has_class ($class)
 Returns true if the specified class has been added to this link.
 

Public Attributes

action_menu $actionmenu = null
 The action menu this link has been added to.
 
array $actions
 List of actions attached to link.
 
array $attributes
 HTML attributes.
 
pix_icon $icon
 Optional pix icon to render with the link.
 
bool $primary = true
 True if this is a primary action.
 
string $text
 Link text HTML fragment.
 
moodle_url $url
 Href url.
 

Static Protected Attributes

static int $instance = 1
 The number of instances of this action menu link (and its subclasses).
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

core\output\action_menu\link::__construct ( moodle_url $url,
?pix_icon $icon,
$text,
$primary = true,
array $attributes = [] )

Constructs the object.

Parameters
moodle_url$urlThe URL for the action.
pix_icon | null$iconThe icon to represent the action.
string$textThe text to represent the action.
bool$primaryWhether this is a primary action or not.
array$attributesAny attribtues associated with the action.

Member Function Documentation

◆ add_action()

core\output\action_link::add_action ( component_action $action)
inherited

Add action to the link.

Parameters
component_action$action

◆ add_class()

core\output\action_link::add_class ( $class)
inherited

Adds a CSS class to this action link object.

Parameters
string$class

◆ export_for_template()

core\output\action_menu\link::export_for_template ( renderer_base $output)

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
stdClass

Reimplemented from core\output\action_link.

◆ get_icon_html()

core\output\action_link::get_icon_html ( )
inherited

Return the rendered HTML for the icon.

Useful for rendering action links in a template.

Return values
string

◆ has_class()

core\output\action_link::has_class ( $class)
inherited

Returns true if the specified class has been added to this link.

Parameters
string$class
Return values
bool

Member Data Documentation

◆ $instance

int core\output\action_menu\link::$instance = 1
staticprotected

The number of instances of this action menu link (and its subclasses).

Deprecated
since Moodle 4.4.

◆ $primary

bool core\output\action_menu\link::$primary = true

True if this is a primary action.

False if not.


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