class TimelineBackground in Views TimelineJS integration 7.3
Defines a TimelineJS3 background object.
Hierarchy
- class \TimelineBackground implements TimelineBackgroundInterface
Expanded class hierarchy of TimelineBackground
File
- src/
TimelineBackground.php, line 6
View source
class TimelineBackground implements TimelineBackgroundInterface {
/**
* The background image url.
*
* @var string
*/
protected $url;
/**
* The background color.
*
* A CSS color, in hexadecimal (e.g. #0f9bd1) or a valid CSS color keyword.
*
* @var string
*/
protected $color;
public function __construct($url = '', $color = '') {
$this->url = $url;
$this->color = $color;
}
/**
* {@inheritdoc}
*/
public function buildArray() {
$background = array();
if (!empty($this->url)) {
$background['url'] = $this->url;
}
if (!empty($this->color)) {
$background['color'] = $this->color;
}
return $background;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TimelineBackground:: |
protected | property | The background color. | |
TimelineBackground:: |
protected | property | The background image url. | |
TimelineBackground:: |
public | function |
Creates an array representing the TimelineJS javascript object. Overrides TimelineObjectInterface:: |
|
TimelineBackground:: |
public | function |