You are here

public function BaseSettingsForm::submitForm in Facebook Instant Articles 3.x

Same name and namespace in other branches
  1. 8.2 src/Form/BaseSettingsForm.php \Drupal\fb_instant_articles\Form\BaseSettingsForm::submitForm()

Form submission handler.

Parameters

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

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

Overrides ConfigFormBase::submitForm

File

src/Form/BaseSettingsForm.php, line 256

Class

BaseSettingsForm
Facebook Instant Articles base settings form.

Namespace

Drupal\fb_instant_articles\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('fb_instant_articles.settings')
    ->set('page_id', $form_state
    ->getValue('page_id'))
    ->set('style', $form_state
    ->getValue('style'))
    ->set('ads.type', $form_state
    ->getValue('ads_type'))
    ->set('ads.iframe_url', $form_state
    ->getValue('ads_iframe_url'))
    ->set('ads.an_placement_id', $form_state
    ->getValue('ads_an_placement_id'))
    ->set('ads.embed_code', $form_state
    ->getValue('ads_embed_code'))
    ->set('ads.dimensions', $form_state
    ->getValue('ads_dimensions'))
    ->set('analytics.embed_code', $form_state
    ->getValue('analytics_embed_code'))
    ->set('transformer_logging_level', $form_state
    ->getValue('transformer_logging_level'))
    ->set('canonical_url_override', $form_state
    ->getValue('canonical_url_override'))
    ->save();
  parent::submitForm($form, $form_state);
}