My goal is rather simple, I need to group several fieldsets in a fieldset like in the image below :
I tried with the following code :
public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form) {
foreach ($this -> order -> getItems() as $key => $order_item) {
dpm($order_item -> getPurchasedEntity() -> getProduct() -> bundle());
$quantity = round($order_item -> getQuantity());
$pane_form['pilote_'.$key] = array(
'#title' => $order_item -> getPurchasedEntity() -> getProduct() -> getTitle(),
'#type' => 'fieldset',
'#description' => "Saisissez les coordonnées des pilotes à assurer",
);
for($i = 0; $i < $quantity; $i ++) {
$pane_form['pilote_'.$key]['ss_pilote_'.$i] = array(
'#title' => 'Pilote '.($i+1),
'#type' => 'fieldset',
);
$pane_form['pilote'.$key]['ss_pilote_'.$i]['pilote_nom_'.$i] = array(
'#type' => 'textfield',
'#title' => 'Nom',
'#default_value' => '',
'#required' => TRUE,
'#size' => 20,
'#attributes' => array(),
);
$pane_form['pilote'.$key]['ss_pilote_'.$i]['pilote_prenom_'.$i] = array(
'#type' => 'textfield',
'#title' => 'Prenom',
'#required' => TRUE,
'#default_value' => '',
'#size' => 20,
'#attributes' => array(),
);
$pane_form['pilote'.$key]['ss_pilote_'.$i]['pilote_email_'.$i] = array(
'#type' => 'textfield',
'#title' => 'Email',
'#default_value' => '',
'#required' => TRUE,
'#size' => 20,
'#attributes' => array(),
);
}
};
return $pane_form;
}
but i still get this :
can anyone help me get the desired result ?
Thanks in advance for your answers :-)