You are here

public static function Files::themeUrl in Bamboo Twig 8

Generate an absolute url to the given theme.

Parameters

string $theme: Theme name.

string $file: File path from theme root.

Return value

string Absolute url to the given file in the theme.

File

bamboo_twig_files/src/TwigExtension/Files.php, line 59

Class

Files
Provides a 'Files' Twig Extensions.

Namespace

Drupal\bamboo_twig_files\TwigExtension

Code

public static function themeUrl($theme, $file) {
  return file_create_url(drupal_get_path('theme', $theme) . '/' . $file);
}