MediaWiki master
|
Class for generating HTML <select> or <datalist> elements. More...
Public Member Functions | |
__construct ( $name=false, $id=false, $default=false) | |
addOption ( $label, $value=false) | |
addOptions ( $options) | |
This accepts an array of form label => value label => ( label => value, label => value ) | |
getAttribute ( $name) | |
getHTML () | |
setAttribute ( $name, $value) | |
setDefault ( $default) | |
setTagName ( $tagName) | |
Static Public Member Functions | |
static | formatOptions ( $options, $default=false) |
This accepts an array of form: label => value label => ( label => value, label => value ) | |
static | parseOptionsMessage (string $msg) |
Parse labels and values out of a comma- and colon-separated list of options, such as is used for expiry and duration lists. | |
Protected Attributes | |
string int[] | $attributes = [] |
string array false | $default = false |
array[] | $options = [] |
string array | $tagName = 'select' |
Class for generating HTML <select> or <datalist> elements.
Definition at line 30 of file XmlSelect.php.
MediaWiki\Xml\XmlSelect::__construct | ( | $name = false, | |
$id = false, | |||
$default = false ) |
Definition at line 40 of file XmlSelect.php.
References MediaWiki\Xml\XmlSelect\$default, and MediaWiki\Xml\XmlSelect\setAttribute().
MediaWiki\Xml\XmlSelect::addOption | ( | $label, | |
$value = false ) |
string | $label | |
string | int | float | false | $value | If not given, assumed equal to $label |
Definition at line 88 of file XmlSelect.php.
MediaWiki\Xml\XmlSelect::addOptions | ( | $options | ) |
This accepts an array of form label => value label => ( label => value, label => value )
array | $options |
Definition at line 100 of file XmlSelect.php.
References MediaWiki\Xml\XmlSelect\$options.
|
static |
This accepts an array of form: label => value label => ( label => value, label => value )
array | $options | |
string | array | false | $default |
Definition at line 113 of file XmlSelect.php.
References MediaWiki\Xml\XmlSelect\$default, MediaWiki\Xml\XmlSelect\$options, MediaWiki\Xml\XmlSelect\formatOptions(), and MediaWiki\Xml\Xml\option().
Referenced by MediaWiki\Xml\XmlSelect\formatOptions(), and MediaWiki\Xml\XmlSelect\getHTML().
MediaWiki\Xml\XmlSelect::getAttribute | ( | $name | ) |
MediaWiki\Xml\XmlSelect::getHTML | ( | ) |
Definition at line 135 of file XmlSelect.php.
References MediaWiki\Xml\XmlSelect\$options, and MediaWiki\Xml\XmlSelect\formatOptions().
|
static |
Parse labels and values out of a comma- and colon-separated list of options, such as is used for expiry and duration lists.
Documentation of the format is on translatewiki.net.
Definition at line 154 of file XmlSelect.php.
References MediaWiki\Xml\XmlSelect\$options.
MediaWiki\Xml\XmlSelect::setAttribute | ( | $name, | |
$value ) |
string | $name | |
string | int | $value |
Definition at line 72 of file XmlSelect.php.
Referenced by MediaWiki\Xml\XmlSelect\__construct().
MediaWiki\Xml\XmlSelect::setDefault | ( | $default | ) |
string | array | $default |
Definition at line 57 of file XmlSelect.php.
References MediaWiki\Xml\XmlSelect\$default.
MediaWiki\Xml\XmlSelect::setTagName | ( | $tagName | ) |
string | array | $tagName |
Definition at line 64 of file XmlSelect.php.
References MediaWiki\Xml\XmlSelect\$tagName.
|
protected |
Definition at line 38 of file XmlSelect.php.
|
protected |
Definition at line 34 of file XmlSelect.php.
Referenced by MediaWiki\Xml\XmlSelect\__construct(), MediaWiki\Xml\XmlSelect\formatOptions(), and MediaWiki\Xml\XmlSelect\setDefault().
|
protected |
Definition at line 32 of file XmlSelect.php.
Referenced by MediaWiki\Xml\XmlSelect\addOptions(), MediaWiki\Xml\XmlSelect\formatOptions(), MediaWiki\Xml\XmlSelect\getHTML(), and MediaWiki\Xml\XmlSelect\parseOptionsMessage().
|
protected |
Definition at line 36 of file XmlSelect.php.
Referenced by MediaWiki\Xml\XmlSelect\setTagName().