You are here

public function SessionExampleForm::__construct in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/session_example/src/Form/SessionExampleForm.php \Drupal\session_example\Form\SessionExampleForm::__construct()

Constructs a new SessionExampleForm object.

Parameters

\Symfony\Component\HttpFoundation\Session\SessionInterface $session: The session object.

\Drupal\Core\Cache\CacheTagsInvalidatorInterface $invalidator: The cache tag invalidator service.

File

session_example/src/Form/SessionExampleForm.php, line 50

Class

SessionExampleForm
Form to allow the user to store information in their session.

Namespace

Drupal\session_example\Form

Code

public function __construct(SessionInterface $session, CacheTagsInvalidatorInterface $invalidator) {
  $this->session = $session;
  $this->cacheTagInvalidator = $invalidator;
}