You are here

public function GoogleOptimizeHidePageController::snippet in Drupal 8 Google Optimize Hide Page 8

Get JS Snippet.

Return value

Response JS Snippet.

1 string reference to 'GoogleOptimizeHidePageController::snippet'
d8_google_optimize_hide_page.routing.yml in ./d8_google_optimize_hide_page.routing.yml
d8_google_optimize_hide_page.routing.yml

File

src/Controller/GoogleOptimizeHidePageController.php, line 20

Class

GoogleOptimizeHidePageController
Implements Google Optimize Hide Page Controller.

Namespace

Drupal\d8_google_optimize_hide_page\Controller

Code

public function snippet() : Response {
  $snippet = new SnippetGenerator();
  return new Response($snippet
    ->getSnippet(), 200, [
    'Content-type' => 'application/javascript',
  ]);
}