class GoogleAnalyticsJavaScriptSnippet in Google Analytics 8.2
Same name and namespace in other branches
- 8.3 src/Component/Render/GoogleAnalyticsJavaScriptSnippet.php \Drupal\google_analytics\Component\Render\GoogleAnalyticsJavaScriptSnippet
- 4.x src/Component/Render/GoogleAnalyticsJavaScriptSnippet.php \Drupal\google_analytics\Component\Render\GoogleAnalyticsJavaScriptSnippet
Formats a string for JavaScript display.
Hierarchy
- class \Drupal\google_analytics\Component\Render\GoogleAnalyticsJavaScriptSnippet implements MarkupInterface
Expanded class hierarchy of GoogleAnalyticsJavaScriptSnippet
1 file declares its use of GoogleAnalyticsJavaScriptSnippet
- google_analytics.module in ./
google_analytics.module - Drupal Module: Google Analytics.
File
- src/
Component/ Render/ GoogleAnalyticsJavaScriptSnippet.php, line 10
Namespace
Drupal\google_analytics\Component\RenderView source
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();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GoogleAnalyticsJavaScriptSnippet:: |
protected | property | The string to escape. | |
GoogleAnalyticsJavaScriptSnippet:: |
public | function | ||
GoogleAnalyticsJavaScriptSnippet:: |
public | function | Constructs an HtmlEscapedText object. | |
GoogleAnalyticsJavaScriptSnippet:: |
public | function |
Returns markup. Overrides MarkupInterface:: |