Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
MoodleQuickForm_url Class Reference

url type form element More...

Inheritance diagram for MoodleQuickForm_url:
templatable

Public Member Functions

 __construct ($elementName=null, $elementLabel=null, $attributes=null, $options=null)
 Constructor.
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template.
 
 get_force_ltr ()
 Get force LTR option.
 
 getElementTemplateType ()
 Slightly different container template when frozen.
 
 getFilePickerHTML ()
 
 getHelpButton ()
 get html for help button
 
 MoodleQuickForm_url ($elementName=null, $elementLabel=null, $attributes=null, $options=null)
 Old syntax of class constructor.
 
 setHiddenLabel ($hiddenLabel)
 Sets label to be hidden.
 
 toHtml ()
 Returns HTML for this form element.
 

Public Attributes

string $_helpbutton =''
 html for help button, if empty then no help
 
bool $_hiddenLabel =false
 if true label will be hidden
 

Protected Member Functions

 get_filepicker_unique_id ()
 Returns the unique id of the file picker associated with this url element, setting it in the process if not set.
 

Protected Attributes

array $_options
 data which need to be posted.
 
string $filepickeruniqueid
 the unique id of the filepicker, if enabled.
 

Detailed Description

url type form element

HTML class for a url type element

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

Constructor & Destructor Documentation

◆ __construct()

MoodleQuickForm_url::__construct ( $elementName = null,
$elementLabel = null,
$attributes = null,
$options = null )

Constructor.

Parameters
string$elementNameElement name
mixed$elementLabelLabel(s) for an element
mixed$attributesEither a typical HTML attribute string or an associative array.
array$optionsdata which need to be posted.

Member Function Documentation

◆ export_for_template()

MoodleQuickForm_url::export_for_template ( renderer_base $output)

Function to export the renderer data in a format that is suitable for a mustache template.

This means:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implements templatable.

◆ get_filepicker_unique_id()

MoodleQuickForm_url::get_filepicker_unique_id ( )
protected

Returns the unique id of the file picker associated with this url element, setting it in the process if not set.

Return values
stringthe unique id of the file picker.

◆ get_force_ltr()

MoodleQuickForm_url::get_force_ltr ( )

Get force LTR option.

Return values
bool

◆ getElementTemplateType()

MoodleQuickForm_url::getElementTemplateType ( )

Slightly different container template when frozen.

Don't want to use a label tag with a for attribute in that case for the element label but instead use a div. Templates are defined in renderer constructor.

Return values
string

◆ getHelpButton()

MoodleQuickForm_url::getHelpButton ( )

get html for help button

Return values
stringhtml for help button

◆ MoodleQuickForm_url()

MoodleQuickForm_url::MoodleQuickForm_url ( $elementName = null,
$elementLabel = null,
$attributes = null,
$options = null )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

◆ setHiddenLabel()

MoodleQuickForm_url::setHiddenLabel ( $hiddenLabel)

Sets label to be hidden.

Parameters
bool$hiddenLabelsets if label should be hidden

◆ toHtml()

MoodleQuickForm_url::toHtml ( )

Returns HTML for this form element.

Return values
string

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