You are here

public function DefaultController::setStyle in Opigno training catalog 8

Same name and namespace in other branches
  1. 3.x src/Controller/DefaultController.php \Drupal\opigno_catalog\Controller\DefaultController::setStyle()

Sets style.

1 string reference to 'DefaultController::setStyle'
opigno_catalog.routing.yml in ./opigno_catalog.routing.yml
opigno_catalog.routing.yml

File

src/Controller/DefaultController.php, line 17

Class

DefaultController
Class DefaultController.

Namespace

Drupal\opigno_catalog\Controller

Code

public function setStyle($style) {
  $tempstore = \Drupal::service('user.private_tempstore')
    ->get('opigno_catalog');
  $tempstore
    ->set('style', $style);
  return new JsonResponse(NULL, Response::HTTP_OK);
}