Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get tempstore. Within classes use dependency injection instead.
- $tempstore = Drupal::service('user.private_tempstore')->get('mymodule_name');
- // Set my_variable_name.
- $tempstore->set('my_variable_name', $data);
- // Get tempstore. Within classes use dependency injection instead.
- $tempstore = Drupal::service('user.private_tempstore')->get('mymodule_name');
- // Get my_variable_name data.
- $data = $tempstore->get('my_variable_name');
Add Comment
Please, Sign In to add comment