Select

Utility class for creating HTML select lists

abstract deprecated
since

1.0

deprecated

The joomla/form package is deprecated

Methods

booleanlist

Generates a yes/no radio list.

booleanlist(string $name, array $attribs = null, string $selected = null, string $yes = 'JYES', string $no = 'JNO', string $id = false) : string
static
see \Joomla\Form\Field\Radio
since

1.0

Arguments

$name

stringThe value of the HTML name attribute

$attribs

arrayAdditional HTML attributes for the tag. This can be an array of attributes, or an array of options. Treated as options if it is the last argument passed. Valid options are: Format options, see {@see Select::$formatOptions}. Selection options, see {@see Select::options()}. list.attr, string|array: Additional attributes for the select element. id, string: Value to use as the select element id attribute. Defaults to the same as the name. list.select, string|array: Identifies one or more option elements to be selected, based on the option key values.

$optKey

stringThe name of the object variable for the option value. If set to null, the index of the value array is used.

$optText

stringThe name of the object variable for the option text.

$selected

mixedThe key that is selected (accepts an array or a string).

$idtag

mixedValue of the field id or null by default

$translate

booleanTrue to translate

Response

stringHTML for the select list.

groupedlist

Generates a grouped HTML selection list from nested arrays.

groupedlist(array $data, string $name, array $options = array()) : string
static
since

1.0

throws

\RuntimeExceptionIf a group has contents that cannot be processed.

Arguments

$data

arrayAn array of groups, each of which is an array of options.

$name

stringThe value of the HTML name attribute

$options

arrayOptions, an array of key/value pairs. Valid options are: Format options, {@see Select::$formatOptions}. Selection options. See {@see Select::options()}. group.id: The property in each group to use as the group id attribute. Defaults to none. group.label: The property in each group to use as the group label. Defaults to "text". If set to null, the data array index key is used. group.items: The property in each group to use as the array of items in the group. Defaults to "items". If set to null, group.id and group. label are forced to null and the data element is assumed to be a list of selections. id: Value to use as the select element id attribute. Defaults to the same as the name. list.attr: Attributes for the select element. Can be a string or an array of key/value pairs. Defaults to none. list.select: either the value of one selected option or an array of selected options. Default: none. list.translate: Boolean. If set, text and labels are translated via Text::_().

Response

stringHTML for the select list

integerlist

Generates a selection list of integers.

integerlist(integer $start, integer $end, integer $inc, string $name, mixed $attribs = null, mixed $selected = null, string $format = '') : string
static
since

1.0

Arguments

$start

integerThe start integer

$end

integerThe end integer

$inc

integerThe increment

$name

stringThe value of the HTML name attribute

$attribs

mixedAdditional HTML attributes for the tag

$optKey

mixedThe key that is selected

$optText

stringThe name of the object variable for the option value

$selected

stringThe name of the object variable for the option text

$idtag

booleanValue of the field id or null by default

$translate

booleanTrue if options will be translated

Response

stringHTML for the select list

Properties

formatOptions

Option values related to the generation of HTML output. Recognized options are: fmtDepth, integer. The current indent depth.

static

fmtEol, string. The end of line string, default is linefeed. fmtIndent, string. The string to use for indentation, default is tab.

since

1.0

Type(s)

array

optionDefaults

Default values for options. Organized by option group.

static
since

1.0

Type(s)

array