You are here

public function Settings::submitForm in Flickr API Integration 8

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/Settings.php, line 161

Class

Settings
Implements the Flickr API Settings form controller.

Namespace

Drupal\flickr_api\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('flickr_api.settings')
    ->set('api_key', $form_state
    ->getValue('api_key'))
    ->set('api_secret', $form_state
    ->getValue('api_secret'))
    ->set('host_uri', $form_state
    ->getValue('host_uri'))
    ->set('api_uri', $form_state
    ->getValue('api_uri'))
    ->set('api_cache_maximum_age', $form_state
    ->getValue('api_cache_maximum_age'))
    ->save();
  parent::submitForm($form, $form_state);
}