menu

Drupal8表单构建元素(下拉列表)

  • date_range 24/07/2017 00:00 info
    sort
    Default
    label


$form['example_select'] = [
'#type' => 'select',
'#title' => $this->t('Select element'),
'#options' => [
'1' => $this->t('One'),
'2' => [
'2.1' => $this->t('Two point one'),
'2.2' => $this->t('Two point two'),
],
'3' => $this->t('Three'),
],
];
编辑