You are here

public function ApiSettingsForm::fbAppDetailsSubmit in Facebook Instant Articles 3.x

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

Form submission handler.

Parameters

array $form: FAPI array.

\Drupal\Core\Form\FormStateInterface $form_state: Form state.

File

src/Form/ApiSettingsForm.php, line 207

Class

ApiSettingsForm
Facebook Instant Articles API form.

Namespace

Drupal\fb_instant_articles\Form

Code

public function fbAppDetailsSubmit(array &$form, FormStateInterface $form_state) {
  $this
    ->config('fb_instant_articles.settings')
    ->set('app_id', $form_state
    ->getValue('app_id'))
    ->set('app_secret', $form_state
    ->getValue('app_secret'))
    ->set('access_token', '')
    ->set('page_access_token', '')
    ->set('page_id', '')
    ->set('page_name', '')
    ->save();
  $form_state
    ->setRedirect('fb_instant_articles.api_settings_form');
}