You are here

public static function TwigTweakExtension::cacheMetadata in Twig Tweak 3.x

Same name and namespace in other branches
  1. 3.1.x src/TwigTweakExtension.php \Drupal\twig_tweak\TwigTweakExtension::cacheMetadata()

Extracts cache metadata from object or render array.

Parameters

\Drupal\Core\Cache\CacheableDependencyInterface|array $input: The cacheable object or render array.

Return value

array A render array with extracted cache metadata.

File

src/TwigTweakExtension.php, line 652

Class

TwigTweakExtension
Twig extension with some useful functions and filters.

Namespace

Drupal\twig_tweak

Code

public static function cacheMetadata($input) : array {
  return \Drupal::service('twig_tweak.cache_metadata_extractor')
    ->extractCacheMetadata($input);
}