Answers for "drupal 8 group fields custom form"

0

drupal 8 group fields custom form

// Gourp field in fieldset.
$form['group'] = [
  '#type' => 'fieldset',
  '#title' => $this->t('Group'),
  '#collapsible' => FALSE,
  '#collapsed' => FALSE,
];

$form['group']['field_1'] = [
 '#type' => 'textfield',
 '#title' => $this->t('Field 1'),
];

$form['group']['field_2'] = [
  '#type' => 'textfield',
  '#title' => $this->t('Field 2'),
];
Posted by: Guest on September-12-2020

Browse Popular Code Answers by Language