Default / 默认 · August 31, 2021

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

Table of Content


$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'),
],
];
%d bloggers like this: