Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
core\output\action_link Class Reference
Inheritance diagram for core\output\action_link:
core\output\renderable core\output\action_menu\filler core\output\action_menu\link core\output\action_menu\subpanel core\output\action_menu\link_primary core\output\action_menu\link_secondary

Public Member Functions

 __construct (moodle_url $url, $text, ?component_action $action=null, ?array $attributes=null, ?pix_icon $icon=null)
 Constructor.
 
 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

array $actions
 List of actions attached to link.
 
array $attributes
 HTML attributes.
 
pix_icon $icon
 Optional pix icon to render with the link.
 
string $text
 Link text HTML fragment.
 
moodle_url $url
 Href url.
 

Constructor & Destructor Documentation

◆ __construct()

core\output\action_link::__construct ( moodle_url $url,
$text,
?component_action $action = null,
?array $attributes = null,
?pix_icon $icon = null )

Constructor.

Parameters
moodle_url$url
string$textHTML fragment
null | component_action$action
null | array$attributesassociative array of html link attributes + disabled
null | pix_icon$iconoptional pix_icon to render with the link text

Member Function Documentation

◆ add_action()

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

Add action to the link.

Parameters
component_action$action

◆ add_class()

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

Adds a CSS class to this action link object.

Parameters
string$class

◆ export_for_template()

core\output\action_link::export_for_template ( renderer_base $output)

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
stdClass

Reimplemented in core\output\action_menu\link.

◆ get_icon_html()

core\output\action_link::get_icon_html ( )

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)

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

Parameters
string$class
Return values
bool

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