class MatomoJavaScriptSnippet in Matomo Analytics 8
Formats a string for JavaScript display.
Hierarchy
- class \Drupal\matomo\Component\Render\MatomoJavaScriptSnippet implements MarkupInterface
Expanded class hierarchy of MatomoJavaScriptSnippet
1 file declares its use of MatomoJavaScriptSnippet
- matomo.module in ./
matomo.module - Drupal Module: Matomo.
File
- src/
Component/ Render/ MatomoJavaScriptSnippet.php, line 10
Namespace
Drupal\matomo\Component\RenderView source
class MatomoJavaScriptSnippet 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 |
---|---|---|---|---|
MatomoJavaScriptSnippet:: |
protected | property | The string to escape. | |
MatomoJavaScriptSnippet:: |
public | function | ||
MatomoJavaScriptSnippet:: |
public | function | Constructs an HtmlEscapedText object. | |
MatomoJavaScriptSnippet:: |
public | function |
Returns markup. Overrides MarkupInterface:: |