You are here

public function DefaultController::styleswitcherSwitch in Style Switcher 8.2

Same name and namespace in other branches
  1. 3.0.x src/Controller/DefaultController.php \Drupal\styleswitcher\Controller\DefaultController::styleswitcherSwitch()

Switches style when JS is disabled.

Parameters

array $style: New active style. The structure of an array is the same as returned from styleswitcher_style_load().

Return value

\Symfony\Component\HttpFoundation\RedirectResponse Response object.

See also

styleswitcher_style_load()

1 string reference to 'DefaultController::styleswitcherSwitch'
styleswitcher.routing.yml in ./styleswitcher.routing.yml
styleswitcher.routing.yml

File

src/Controller/DefaultController.php, line 66

Class

DefaultController
Default controller for the styleswitcher module.

Namespace

Drupal\styleswitcher\Controller

Code

public function styleswitcherSwitch(array $style) {
  if ($style['status']) {
    $this
      ->saveUserPreference($style['theme'], $style['name']);
  }
  return $this
    ->redirect('<front>');
}