You are here

public function ViewsMenuLinkForm::extractFormValues in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/Menu/Form/ViewsMenuLinkForm.php \Drupal\views\Plugin\Menu\Form\ViewsMenuLinkForm::extractFormValues()
  2. 10 core/modules/views/src/Plugin/Menu/Form/ViewsMenuLinkForm.php \Drupal\views\Plugin\Menu\Form\ViewsMenuLinkForm::extractFormValues()

Extracts a plugin definition from form values.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The new plugin definition values taken from the form values. The plugin ID must be returned as part of the definition.

Overrides MenuLinkDefaultForm::extractFormValues

File

core/modules/views/src/Plugin/Menu/Form/ViewsMenuLinkForm.php, line 72

Class

ViewsMenuLinkForm
Provides a form to edit Views menu links.

Namespace

Drupal\views\Plugin\Menu\Form

Code

public function extractFormValues(array &$form, FormStateInterface $form_state) {
  $definition = parent::extractFormValues($form, $form_state);
  $definition['title'] = $form_state
    ->getValue('title');
  $definition['description'] = $form_state
    ->getValue('description');
  return $definition;
}