public static function PathUtils::resolvePath

5 calls to PathUtils::resolvePath()
AssetWriter::writeAsset in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php
FileAsset::getLastModified in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php
Returns the time the current asset was last modified.
FileAsset::load in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php
Loads the asset into memory and applies load filters.
GlobAsset::initialize in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php
Initializes the collection based on the glob(s) passed in.
HttpAsset::load in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php
Loads the asset into memory and applies load filters.

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Util/PathUtils.php, line 12

Class

PathUtils
Path Utils.

Namespace

Assetic\Util

Code

public static function resolvePath($path, array $vars, array $values) {
  $map = array();
  foreach ($vars as $var) {
    if (false === strpos($path, '{' . $var . '}')) {
      continue;
    }
    if (!isset($values[$var])) {
      throw new \InvalidArgumentException(sprintf('The path "%s" contains the variable "%s", but was not given any value for it.', $path, $var));
    }
    $map['{' . $var . '}'] = $values[$var];
  }
  return strtr($path, $map);
}