You are here

public function BackgroundImage::getCssUri in Background Image 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::getCssUri()
  2. 2.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::getCssUri()

Retrieves the CSS file this background image.

Return value

string An internal scheme path to the CSS file.

Overrides BackgroundImageInterface::getCssUri

File

src/Entity/BackgroundImage.php, line 316

Class

BackgroundImage
Defines the Background Image entity.

Namespace

Drupal\background_image\Entity

Code

public function getCssUri() {
  $default_scheme = \Drupal::config('system.file')
    ->get('default_scheme');
  $min = $this
    ->getBackgroundImageManager()
    ->useMinifiedCssUri() ? '.min' : '';
  return "{$default_scheme}://background_image/css/{$this->id()}/{$default_scheme}/{$this->getImageHash()}{$min}.css";
}