Récuperer valeur d'une listbox
Bonjour,
j'ai crée un configuration sur un bloc drupal qui permet d'afficher une listbox, je souhaite maintenant récuperer la valeur que l'on selectionne dans mon code PHP (j'ai défini un variable privée dans la classe pour contenir la chaine), je ne vois pas bien comment :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| public function blockForm($form, FormStateInterface $form_state) {
$form = parent::blockForm($form, $form_state);
$form['example_select'] = [
'#type' => 'select',
'#title' => t('Select element'),
'#options' => [
'1' => t('one'),
'2' => t('two')
]
];
return $form;
}
public function blockSubmit($form, FormStateInterface $form_state) {
} |
Cordialement