function SystemBrandingOffCanvasForm::submitConfigurationForm

Same name in other branches
  1. 9 core/modules/system/src/Form/SystemBrandingOffCanvasForm.php \Drupal\system\Form\SystemBrandingOffCanvasForm::submitConfigurationForm()
  2. 8.9.x core/modules/system/src/Form/SystemBrandingOffCanvasForm.php \Drupal\system\Form\SystemBrandingOffCanvasForm::submitConfigurationForm()
  3. 11.x core/modules/system/src/Form/SystemBrandingOffCanvasForm.php \Drupal\system\Form\SystemBrandingOffCanvasForm::submitConfigurationForm()

Overrides PluginFormInterface::submitConfigurationForm

File

core/modules/system/src/Form/SystemBrandingOffCanvasForm.php, line 114

Class

SystemBrandingOffCanvasForm
The settings_tray form handler for the SystemBrandingBlock.

Namespace

Drupal\system\Form

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    $site_config = $this->configFactory
        ->get('system.site');
    if (AccessResult::allowedIf(!$site_config->hasOverrides('name') && !$site_config->hasOverrides('slogan'))
        ->isAllowed()) {
        $site_info = $form_state->getValue('site_information');
        $this->configFactory
            ->getEditable('system.site')
            ->set('name', $site_info['site_name'])
            ->set('slogan', $site_info['site_slogan'])
            ->save();
    }
    $this->plugin
        ->submitConfigurationForm($form, $form_state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.