You are here

public function Container::getSnippetContents in GoogleTagManager 8

Returns the snippet contents for the snippet type.

Parameters

string $type: The snippet type.

Return value

string The snippet contents.

2 calls to Container::getSnippetContents()
Container::inlineTag in src/Entity/Container.php
Returns tag array for the snippet type.
Container::noscriptTag in src/Entity/Container.php
Returns tag array for the snippet type.

File

src/Entity/Container.php, line 640

Class

Container
Defines the container configuration entity.

Namespace

Drupal\google_tag\Entity

Code

public function getSnippetContents($type) {
  $cache = \Drupal::service('cache.data')
    ->get($this
    ->snippetCid($type));
  return $cache ? $cache->data : '';
}