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');
        ->set('ldap_filter', $filter)

      $roles = $form_state->getValue('roles_list');
        ->set('roles', $roles)

It is working but each save override the previous one.

How can i structure the yml to save a list of datas iterately


ldap_filter: ""
roles: null

i have been trying a schema file although i am not sure it if it is considered at all


  type: config_object
  label: 'couple filtreLDAP / roles'
      type: text
      label: 'Filtre LDAP'
      type: array
      label: 'Rôles'

i have seen things like



Leave an answer

Your email address will not be published. Required fields are marked *