public function BaseAsset::setTargetPath

Sets the URL for the current asset.

Parameters

string $targetPath A web URL where the asset will be dumped:

Overrides AssetInterface::setTargetPath

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php, line 138

Class

BaseAsset
A base abstract asset.

Namespace

Assetic\Asset

Code

public function setTargetPath($targetPath) {
  if ($this->vars) {
    foreach ($this->vars as $var) {
      if (false === strpos($targetPath, $var)) {
        throw new \RuntimeException(sprintf('The asset target path "%s" must contain the variable "{%s}".', $targetPath, $var));
      }
    }
  }
  $this->targetPath = $targetPath;
}