Categories
CMS Drupal Mastering Development

structure of config yml file to save iterately on each form submit a pair of values

i am having a form with 2 values to save on submit: public function submitForm(array &$form, FormStateInterface $form_state) { if ($_POST[‘op’] == ‘Import Accounts’) { $filter = $form_state->getValue(‘ldap_filter’); \Drupal::configFactory()->getEditable(‘amu_import_ldap.settings’) ->set(‘ldap_filter’, $filter) ->save(); $roles = $form_state->getValue(‘roles_list’); \Drupal::configFactory()->getEditable(‘amu_import_ldap.settings’) ->set(‘roles’, $roles) ->save(); } It is working but each save override the previous one. How can i structure the […]