HTML_QuickForm_hierselect::setOptions()

HTML_QuickForm_hierselect::setOptions() -- Sets the options for the select elements

Synopsis

require_once 'HTML/QuickForm/hierselect.php';

void HTML_QuickForm_hierselect::setOptions (array $options)

ïÐÉÓÁÎÉÅ

Sets the options for the select elements within hierselect. Note that the actual number of selects that will be displayed is governed by the number of the elements in the array passed to this function.

ðÁÒÁÍÅÔÒ

array $options

Array of options for the elements, having the following structure:
array(
  // options for the first element
  array(
    'key_1' => 'value 1',
    'key_2' => 'value 2',
    ...
    'key_N' => 'value N',
  ),
  // options for the second element
  array(
    'key_1' => array(
      'key_1_1' => 'value 1.1',
      'key_1_2' => 'value 1.2',
      ...
      'key_1_M1' => 'value 1.M1'
    ),
    'key_2' => array(
      'key_2_1' => 'value 2.1',
      'key_2_2' => 'value 2.2',
      ...
      'key_2_M2' => 'value 2.M2'
    ),
    ...
    'key_N' => array(
      'key_N_1' => 'value N.1',
      'key_N_2' => 'value N.2',
      ...
      'key_N_MN' => 'value N.MN'
    )
  )
  // options for further elements
  ...
)

Замечание: The options for subsequent elements should have keys for all options of the previous elements. Having a select without options is invalid HTML and will break hierselect's JavaScript. See also Bug #5218.

Throws

throws no exceptions thrown

úÁÍÅÔËÁ

üÔÁ ÆÕÎËÃÉÑ ÎÅ ÄÏÌÖÎÁ ×ÙÚÙ×ÁÔØÓÑ ÓÔÁÔÉÞÅÓËÉ.

since 3.2.2

ðÒÉÍÅÒ


HIVE: All information for read only. Please respect copyright!
Hosted by hive ÊÃÁ: Êèåâñêàÿ ãîðîäñêàÿ áèáëèîòåêà