Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Attributes | List of all members
cached_cm_info Class Reference

Class that is the return value for the _get_coursemodule_info module API function. More...

Public Attributes

string $content
 HTML content to be displayed on the main page below the link (if any) for this course-module.
 
mixed $customdata
 Custom data to be stored in modinfo for this activity; useful if there are cases when internal information for this activity type needs to be accessible from elsewhere on the course without making database queries. More...
 
string $extraclasses
 Extra CSS class or classes to be added when this activity is displayed on the main page; space-separated string.
 
string $icon
 Name of icon for this activity. More...
 
string $iconcomponent
 Component for icon for this activity, as per image_url; leave blank to use default 'moodle' component. More...
 
$moodle_url $iconurl
 External URL image to be used by activity as icon, useful for some external-tool modules like lti. More...
 
string $name
 Name (text of link) for this activity; Leave unset to accept default name.
 
string $onclick
 Content of onclick JavaScript; escaped HTML to be inserted as attribute value.
 

Detailed Description

Class that is the return value for the _get_coursemodule_info module API function.

Note: For backward compatibility, you can also return a stdclass object from that function. The difference is that the stdclass object may contain an 'extra' field (deprecated, use extraclasses and onclick instead). The stdclass object may not contain the new fields defined here (content, extraclasses, customdata).

Member Data Documentation

◆ $customdata

mixed cached_cm_info::$customdata

Custom data to be stored in modinfo for this activity; useful if there are cases when internal information for this activity type needs to be accessible from elsewhere on the course without making database queries.

May be of any type but should be short.

◆ $icon

string cached_cm_info::$icon

Name of icon for this activity.

Normally, this should be used together with $iconcomponent to define the icon, as per image_url function. For backward compatibility, if this value is of the form 'mod/forum/icon' then an icon within that module will be used.

See also
cm_info::get_icon_url()
renderer_base::image_url()

◆ $iconcomponent

string cached_cm_info::$iconcomponent

Component for icon for this activity, as per image_url; leave blank to use default 'moodle' component.

See also
renderer_base::image_url()

◆ $iconurl

$moodle_url cached_cm_info::$iconurl

External URL image to be used by activity as icon, useful for some external-tool modules like lti.

If set, takes precedence over $icon and $iconcomponent


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