public function DefaultController::styleswitcherSwitch in Style Switcher 3.0.x
Same name and namespace in other branches
- 8.2 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
1 string reference to 'DefaultController::styleswitcherSwitch'
File
- src/
Controller/ DefaultController.php, line 66
Class
- DefaultController
- Default controller for the styleswitcher module.
Namespace
Drupal\styleswitcher\ControllerCode
public function styleswitcherSwitch(array $style) {
if ($style['status']) {
$this
->saveUserPreference($style['theme'], $style['name']);
}
return $this
->redirect('<front>');
}