You are here

public function View::submitConfigurationForm in Entity Browser 8

Same name in this branch
  1. 8 src/Plugin/EntityBrowser/Widget/View.php \Drupal\entity_browser\Plugin\EntityBrowser\Widget\View::submitConfigurationForm()
  2. 8 src/Plugin/EntityBrowser/SelectionDisplay/View.php \Drupal\entity_browser\Plugin\EntityBrowser\SelectionDisplay\View::submitConfigurationForm()
Same name and namespace in other branches
  1. 8.2 src/Plugin/EntityBrowser/SelectionDisplay/View.php \Drupal\entity_browser\Plugin\EntityBrowser\SelectionDisplay\View::submitConfigurationForm()

Implements PluginFormInterface::submitConfigurationForm().

This is the default implementation for the most common cases where the form element names match keys in configuration array. Plugins can override this if they need more complex logic.

Overrides PluginConfigurationFormTrait::submitConfigurationForm

File

src/Plugin/EntityBrowser/SelectionDisplay/View.php, line 112

Class

View
Displays current selection in a View.

Namespace

Drupal\entity_browser\Plugin\EntityBrowser\SelectionDisplay

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  if (!empty($values['view'])) {
    list($view_id, $display_id) = explode('.', $values['view']);
    $this->configuration['view'] = $view_id;
    $this->configuration['view_display'] = $display_id;
  }
}