GoogleAnalyticsJavaScriptSnippet.php in Google Analytics 8.2
Same filename and directory in other branches
Namespace
Drupal\google_analytics\Component\RenderFile
src/Component/Render/GoogleAnalyticsJavaScriptSnippet.phpView source
<?php
namespace Drupal\google_analytics\Component\Render;
use Drupal\Component\Render\MarkupInterface;
/**
* Formats a string for JavaScript display.
*/
class GoogleAnalyticsJavaScriptSnippet implements MarkupInterface {
/**
* The string to escape.
*
* @var string
*/
protected $string;
/**
* Constructs an HtmlEscapedText object.
*
* @param string $string
* The string to escape. This value will be cast to a string.
*/
public function __construct($string) {
$this->string = (string) $string;
}
/**
* {@inheritdoc}
*/
public function __toString() {
return $this->string;
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() {
return $this
->__toString();
}
}
Classes
Name | Description |
---|---|
GoogleAnalyticsJavaScriptSnippet | Formats a string for JavaScript display. |