[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/form/ -> select.php (summary)

select type form element Contains HTML class for a select type element

Copyright: 2006 Jamie Pratt <me@jamiep.org>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 192 lines (6 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MoodleQuickForm_select:: (9 methods):
  __construct()
  MoodleQuickForm_select()
  setHiddenLabel()
  toHtml()
  getHelpButton()
  removeOption()
  removeOptions()
  getElementTemplateType()
  exportValue()


Class: MoodleQuickForm_select  - X-Ref

select type form element

HTML class for a select type element

__construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)   X-Ref
constructor

param: string $elementName Select name attribute
param: mixed $elementLabel Label(s) for the select
param: mixed $options Data to be used to populate options
param: mixed $attributes Either a typical HTML attribute string or an associative array

MoodleQuickForm_select($elementName=null, $elementLabel=null, $options=null, $attributes=null)   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


setHiddenLabel($hiddenLabel)   X-Ref
Sets label to be hidden

param: bool $hiddenLabel sets if label should be hidden

toHtml()   X-Ref
Returns HTML for select form element.

return: string

getHelpButton()   X-Ref
get html for help button

return: string html for help button

removeOption($value)   X-Ref
Removes an OPTION from the SELECT

param: string $value Value for the OPTION to remove
return: void

removeOptions()   X-Ref
Removes all OPTIONs from the SELECT


getElementTemplateType()   X-Ref
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: string

exportValue(&$submitValues, $assoc = false)   X-Ref
We check the options and return only the values that _could_ have been
selected. We also return a scalar value if select is not "multiple"

param: array $submitValues submitted values
param: bool $assoc if true the retured value is associated array
return: mixed



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1