You are here

public function StaticPreviewController::build in Tome 8

Removes the session variable and redirects a user back to the form.

1 string reference to 'StaticPreviewController::build'
tome_static.routing.yml in modules/tome_static/tome_static.routing.yml
modules/tome_static/tome_static.routing.yml

File

modules/tome_static/src/Controller/StaticPreviewController.php, line 48

Class

StaticPreviewController
Allows a user to exit a static preview.

Namespace

Drupal\tome_static\Controller

Code

public function build() {
  $this->session
    ->remove(StaticPreviewRequestSubscriber::SESSION_KEY);
  $url = Url::fromRoute('tome_static.preview_form')
    ->setAbsolute()
    ->toString();
  return new RedirectResponse($url);
}