Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | Static Protected Attributes | List of all members
action_menu_link_primary Class Reference
Inheritance diagram for action_menu_link_primary:
action_menu_link action_link renderable renderable

Public Member Functions

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

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. More...
 
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).
 

Constructor & Destructor Documentation

◆ __construct()

action_menu_link_primary::__construct ( moodle_url  $url,
pix_icon  $icon = null,
  $text,
array  $attributes = array() 
)

Constructs the object.

Parameters
moodle_url$url
pix_icon$icon
string$text
array$attributes

Member Function Documentation

◆ add_action()

action_link::add_action ( component_action  $action)
inherited

Add action to the link.

Parameters
component_action$action

◆ add_class()

action_link::add_class (   $class)
inherited

Adds a CSS class to this action link object.

Parameters
string$class

◆ export_for_template()

action_menu_link::export_for_template ( renderer_base  $output)
inherited

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
stdClass

Reimplemented from action_link.

◆ get_icon_html()

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()

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

◆ $primary

bool action_menu_link::$primary = true
inherited

True if this is a primary action.

False if not.


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