class CSSSnippet in Background Image Field 8
This class will clean up the css string we have created in the formatter.
Hierarchy
- class \Drupal\bg_img_field\Component\Render\CSSSnippet implements MarkupInterface
Expanded class hierarchy of CSSSnippet
1 file declares its use of CSSSnippet
- BgImgFieldFormatter.php in src/
Plugin/ Field/ FieldFormatter/ BgImgFieldFormatter.php
File
- src/
Component/ Render/ CSSSnippet.php, line 10
Namespace
Drupal\bg_img_field\Component\RenderView source
class CSSSnippet 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 |
---|---|---|---|---|
CSSSnippet:: |
protected | property | The string to escape. | |
CSSSnippet:: |
public | function | ||
CSSSnippet:: |
public | function | Constructs an HtmlEscapedText object. | |
CSSSnippet:: |
public | function |
Returns markup. Overrides MarkupInterface:: |