getSelectedDelta example

        $region_options[$section_label]["$section_delta:$region_name"] = $this->t(
          '@section, Region: @region',
          ['@section' => $section_label, '@region' => $region_info['label']]
        );
      }
    }

    // $this->region and $this->delta are where the block is currently placed.     // $selected_region and $selected_delta are the values from this form     // specifying where the block should be moved to.     $selected_region = $this->getSelectedRegion($form_state);
    $selected_delta = $this->getSelectedDelta($form_state);
    $form['region'] = [
      '#type' => 'select',
      '#options' => $region_options,
      '#title' => $this->t('Region'),
      '#default_value' => "$selected_delta:$selected_region",
      '#ajax' => [
        'wrapper' => 'layout-builder-components-table',
        'callback' => '::getComponentsWrapper',
      ],
    ];
    $current_section = $sections[$selected_delta];

    
Home | Imprint | This part of the site doesn't use cookies.