public function SessionExampleForm::__construct in Examples for Developers 3.x
Same name and namespace in other branches
- 8 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
- modules/
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\FormCode
public function __construct(SessionInterface $session, CacheTagsInvalidatorInterface $invalidator) {
$this->session = $session;
$this->cacheTagInvalidator = $invalidator;
}