(no description)
File Size: | 207 lines (6 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
choicelist:: (11 methods):
__construct()
add_option()
count_options()
set_selected_value()
get_selected_value()
set_description()
get_description()
set_option_disabled()
set_option_extras()
export_for_template()
get_template_name()
Class: choicelist - X-Ref
A generic user choice output class.__construct(?string $description = null) X-Ref |
Constructor. param: string $description the choice description. |
add_option(string $value, string $name, array $definition = []) X-Ref |
Add option to the user choice. The definition object could contain the following keys: - string description: the description of the option. - \moodle_url url: the URL to link to. - \pix_icon icon: the icon to display. - bool disabled: whether the option is disabled. - bool selected: whether the option is selected. - array extras: an array of HTML attributes to add to the option (attribute => value). param: string $value param: string $name param: array $definition an optional array of definition for the option. |
count_options() X-Ref |
Get the number of options added to the choice list. return: int |
set_selected_value(string $value) X-Ref |
Set the selected option. param: string $value The value of the selected option. |
get_selected_value() X-Ref |
Get the selected option. return: string|null The value of the selected option. |
set_description(string $value) X-Ref |
Set the general choice description option. param: string $value the new description. |
get_description() X-Ref |
Get the choice description option. return: string|null the current description. |
set_option_disabled(string $value, bool $disabled) X-Ref |
Set the option disabled. param: string $value The value of the option. param: bool $disabled Whether the option is disabled. |
set_option_extras(string $value, array $extras) X-Ref |
Set the option disabled. param: string $value The value of the option. param: array $extras an array to add HTML attributes to the option (attribute => value). |
export_for_template(renderer_base $output) X-Ref |
Export for template. param: renderer_base $output The renderer. return: array |
get_template_name(renderer_base $renderer) X-Ref |
Get the name of the template to use for this templatable. param: renderer_base $renderer The renderer requesting the template name return: string |