You are here

public function SimpleInstagramBlock::blockSubmit in Simple Instagram Feed Block 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/Block/SimpleInstagramBlock.php \Drupal\simple_instagram_feed\Plugin\Block\SimpleInstagramBlock::blockSubmit()
  2. 8.2 src/Plugin/Block/SimpleInstagramBlock.php \Drupal\simple_instagram_feed\Plugin\Block\SimpleInstagramBlock::blockSubmit()
  3. 1.0.x src/Plugin/Block/SimpleInstagramBlock.php \Drupal\simple_instagram_feed\Plugin\Block\SimpleInstagramBlock::blockSubmit()

Adds block type-specific submission handling for the block form.

Note that this method takes the form structure and form state for the full block configuration form as arguments, not just the elements defined in BlockPluginInterface::blockForm().

Parameters

array $form: The form definition array for the full block configuration form.

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

Overrides BlockPluginTrait::blockSubmit

See also

\Drupal\Core\Block\BlockPluginInterface::blockForm()

\Drupal\Core\Block\BlockPluginInterface::blockValidate()

File

src/Plugin/Block/SimpleInstagramBlock.php, line 87

Class

SimpleInstagramBlock
Provides a block with a dynamic Instagram Feed.

Namespace

Drupal\simple_instagram_feed\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  parent::blockSubmit($form, $form_state);
  $values = $form_state
    ->getValues();
  $this->configuration['simple_instagram_username'] = $values['simple_instagram_username'];
  $this->configuration['simple_instagram_display_profile'] = $values['simple_instagram_display_profile'];
  $this->configuration['simple_instagram_display_biography'] = $values['simple_instagram_display_biography'];
  $this->configuration['simple_instagram_items'] = $values['simple_instagram_items'];
  $this->configuration['simple_instagram_items_per_row'] = $values['simple_instagram_items_per_row'];
}