You are here

public static function TwigTweakExtension::fileUriFilter in Twig Tweak 3.1.x

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

Returns a URI to the file.

Parameters

object $input: An object that contains the URI.

Return value

string|null A URI that may be used to access the file.

File

src/TwigTweakExtension.php, line 608

Class

TwigTweakExtension
Twig extension with some useful functions and filters.

Namespace

Drupal\twig_tweak

Code

public static function fileUriFilter($input) : ?string {
  return \Drupal::service('twig_tweak.uri_extractor')
    ->extractUri($input);
}