You are here

public function FacebookCommentsBlock::blockSubmit in Facebook Comments Social Plugin 8

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/FacebookCommentsBlock.php, line 122

Class

FacebookCommentsBlock
Provides a Facebook Comments Block

Namespace

Drupal\facebook_comments\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $this
    ->setConfigurationValue('facebook_comments_style', $form_state
    ->getValue('facebook_comments_style'));
  $this
    ->setConfigurationValue('facebook_comments_width', $form_state
    ->getValue('facebook_comments_width'));
  $this
    ->setConfigurationValue('facebook_comments_width_fluid', $form_state
    ->getValue('facebook_comments_width_fluid'));
  $this
    ->setConfigurationValue('facebook_comments_amount', $form_state
    ->getValue('facebook_comments_amount'));
}