You are here

public function ErlLayout::submitConfigurationForm in Entity Reference with Layout 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides LayoutDefault::submitConfigurationForm

File

modules/erl_layouts/src/Plugin/Layout/ErlLayout.php, line 263

Class

ErlLayout
Layout class with various formatting options for custom ERL layouts.

Namespace

Drupal\erl_layouts\Plugin\Layout

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $this->configuration['layout_classes'] = $form_state
    ->getValue('layout_classes');
  $this->configuration['layout_bg_color'] = $form_state
    ->getValue('layout_bg_color');
  $this->configuration['column_priority'] = $form_state
    ->getValue('column_priority');
  foreach ($this
    ->getPluginDefinition()
    ->getRegions() as $region => $region_info) {
    $this->configuration[$region]['classes'] = $form_state
      ->getValue([
      $region,
      'classes',
    ]);
    $this->configuration[$region]['bg_color'] = $form_state
      ->getValue([
      $region,
      'bg_color',
    ]);
  }
}