public function File::extensionGuesser in Bamboo Twig 8.5
Same name and namespace in other branches
- 8.2 bamboo_twig_file/src/TwigExtension/File.php \Drupal\bamboo_twig_file\TwigExtension\File::extensionGuesser()
- 8.3 bamboo_twig_file/src/TwigExtension/File.php \Drupal\bamboo_twig_file\TwigExtension\File::extensionGuesser()
- 8.4 bamboo_twig_file/src/TwigExtension/File.php \Drupal\bamboo_twig_file\TwigExtension\File::extensionGuesser()
Makes a best guess for a file extension, given a mime type.
Parameters
string $mime_type: The mime type.
Return value
string The guessed extension or NULL, if none could be guessed.
File
- bamboo_twig_file/
src/ TwigExtension/ File.php, line 59
Class
- File
- Provides a 'File' Twig Extensions.
Namespace
Drupal\bamboo_twig_file\TwigExtensionCode
public function extensionGuesser($mime_type) {
$exts = $this
->getExtensionGuesser()
->getExtensions($mime_type);
return $exts[0] ?? NULL;
}