function ComponentMetadata::getThumbnailPath

Same name in this branch
  1. 10 core/modules/sdc/src/Component/ComponentMetadata.php \Drupal\sdc\Component\ComponentMetadata::getThumbnailPath()
Same name in other branches
  1. 11.x core/modules/sdc/src/Component/ComponentMetadata.php \Drupal\sdc\Component\ComponentMetadata::getThumbnailPath()
  2. 11.x core/lib/Drupal/Core/Theme/Component/ComponentMetadata.php \Drupal\Core\Theme\Component\ComponentMetadata::getThumbnailPath()

Gets the thumbnail path.

Return value

string The path.

File

core/lib/Drupal/Core/Theme/Component/ComponentMetadata.php, line 176

Class

ComponentMetadata
Component metadata.

Namespace

Drupal\Core\Theme\Component

Code

public function getThumbnailPath() : string {
    if (!isset($this->thumbnailPath)) {
        $thumbnail_path = sprintf('%s/thumbnail.png', $this->path);
        $this->thumbnailPath = file_exists($thumbnail_path) ? $thumbnail_path : '';
    }
    return $this->thumbnailPath;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.