[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Form/ -> OptGroup.php (summary)

(no description)

File Size: 106 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

OptGroup:: (5 methods):
  __construct()
  storeValue()
  options()
  toHTML()
  renderOptions()


Class: OptGroup  - X-Ref

__construct($label, $options)   X-Ref

param: string $label The label text for this element (will be autoescaped)
param: array  $options The available options

storeValue($value)   X-Ref
Store the given value so it can be used during rendering

This is intended to be only called from within @see DropdownElement::val()

param: string $value
return: bool true if an option with the given value exists, false otherwise

options($options = null)   X-Ref
Get or set the options of the optgroup

Options can be given as associative array (value => label) or as an
indexd array (label = value) or as an array of arrays. In the latter
case an element has to look as follows:
option-value => array (
'label' => option-label,
'attrs' => array (
attr-key => attr-value, ...
)
)

param: null|array $options
return: $this|array

toHTML()   X-Ref
The HTML representation of this element

return: string

renderOptions()   X-Ref

return: string