public function AssetReference::getSourcePath

Returns the relative path for the source asset.

This value can be combined with the asset's source root (if both are non-null) to get something compatible with file_get_contents().

For example:

  • 'js/main.js'
  • 'main.js'
  • null

Return value

string|null The source asset path

Overrides AssetInterface::getSourcePath

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php, line 81

Class

AssetReference
A reference to an asset in the asset manager.

Namespace

Assetic\Asset

Code

public function getSourcePath() {
  return $this
    ->callAsset(__FUNCTION__);
}