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