Default / 默认 · 8月 31, 2021

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

内容纲要


$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 博主赞过: