class JHtmlSelect


Located at : UKNOWVA_ROOT/libraries/joomla/html/html/select.php

Utility class for creating HTML select lists

Methods

static string
booleanlist($name, $attribs = null, $selected = null, $yes = 'JYES', $no = 'JNO', $id = false)

Generates a yes/no radio list.

static string
genericlist($data, $name, $attribs = null, $optKey = 'value', $optText = 'text', $selected = null, $idtag = false, $translate = false)

Generates an HTML selection list.

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

Generates a grouped HTML selection list from nested arrays.

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

Generates a selection list of integers.

static object
optgroup($text, $optKey = 'value', $optText = 'text') deprecated

Create a placeholder for an option group.

static object
option($value, $text = '', $optKey = 'value', $optText = 'text', $disable = false)

Create an object that represents an option in an option list.

static string
options($arr, $optKey = 'value', $optText = 'text', $selected = null, $translate = false)

Generates the option tags for an HTML select list (with no select tag surrounding the options).

static string
radiolist(array $data, string $name, string $attribs = null, mixed $optKey = 'value', string $optText = 'text', string $selected = null, boolean $idtag = false, boolean $translate = false)

Generates an HTML radio list.

Details

at line 56
static string booleanlist($name, $attribs = null, $selected = null, $yes = 'JYES', $no = 'JNO', $id = false)

Generates a yes/no radio list.

Parameters

$name
$attribs
$selected
$yes
$no
$id

Return Value

string HTML for the radio list

See also

JFormFieldRadio

at line 93
static string genericlist($data, $name, $attribs = null, $optKey = 'value', $optText = 'text', $selected = null, $idtag = false, $translate = false)

Generates an HTML selection list.

Parameters

$data
$name
$attribs
$optKey
$optText
$selected
$idtag
$translate

Return Value

string HTML for the select list.

at line 176
static string groupedlist(array $data, string $name, array $options = array())

Generates a grouped HTML selection list from nested arrays.

Parameters

array $data An array of groups, each of which is an array of options.
string $name The value of the HTML name attribute
array $options Options, an array of key/value pairs. Valid options are: Format options, {see JHtml::$formatOptions}. Selection options. See {see JTtmlSelect::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 JText::_().

Return Value

string HTML for the select list

Exceptions

JException If a group has unprocessable contents.

at line 309
static string integerlist(integer $start, integer $end, integer $inc, string $name, mixed $attribs = null, mixed $selected = null, string $format = '')

Generates a selection list of integers.

Parameters

integer $start The start integer
integer $end The end integer
integer $inc The increment
string $name The value of the HTML name attribute
mixed $attribs Additional HTML attributes for the
mixed $selected The key that is selected
string $format The printf format to be applied to the number

Return Value

string HTML for the select list

at line 362
static object optgroup($text, $optKey = 'value', $optText = 'text') deprecated

deprecated Use JHtmlSelect::groupedList() instead

Create a placeholder for an option group.

Parameters

$text
$optKey
$optText

Return Value

object

See also

JHtmlSelect::groupedList()

at line 417
static object option($value, $text = '', $optKey = 'value', $optText = 'text', $disable = false)

Create an object that represents an option in an option list.

Parameters

$value
$text
$optKey
$optText
$disable

Return Value

object

at line 509
static string options($arr, $optKey = 'value', $optText = 'text', $selected = null, $translate = false)

Generates the option tags for an HTML select list (with no select tag surrounding the options).

Parameters

$arr
$optKey
$optText
$selected
$translate

Return Value

string HTML for the select list

at line 669
static string radiolist(array $data, string $name, string $attribs = null, mixed $optKey = 'value', string $optText = 'text', string $selected = null, boolean $idtag = false, boolean $translate = false)

Generates an HTML radio list.

Parameters

array $data An array of objects
string $name The value of the HTML name attribute
string $attribs Additional HTML attributes for the
mixed $optKey The key that is selected
string $optText The name of the object variable for the option value
string $selected The name of the object variable for the option text
boolean $idtag Value of the field id or null by default
boolean $translate True if options will be translated

Return Value

string HTML for the select list