Guest User

Untitled

a guest
Dec 11th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // Get tempstore. Within classes use dependency injection instead.
  2. $tempstore = Drupal::service('user.private_tempstore')->get('mymodule_name');
  3. // Set my_variable_name.
  4. $tempstore->set('my_variable_name', $data);
  5.  
  6. // Get tempstore. Within classes use dependency injection instead.
  7. $tempstore = Drupal::service('user.private_tempstore')->get('mymodule_name');
  8. // Get my_variable_name data.
  9. $data = $tempstore->get('my_variable_name');
Add Comment
Please, Sign In to add comment