function AssetDumper::dump
The file name for the CSS or JS cache file is generated from the hash of the aggregated contents of the files in $data. This forces proxies and browsers to download new CSS when the CSS changes.
Parameters
string $data: An (optimized) asset's contents.
string $file_extension: The file extension of this asset.
Return value
string A URI to access the dumped asset.
Overrides AssetDumperInterface::dump
File
- 
              core/
lib/ Drupal/ Core/ Asset/ AssetDumper.php, line 39  
Class
- AssetDumper
 - Dumps a CSS or JavaScript asset.
 
Namespace
Drupal\Core\AssetCode
public function dump($data, $file_extension) {
  $path = 'assets://' . $file_extension;
  // Prefix filename to prevent blocking by firewalls which reject files
  // starting with "ad*".
  $filename = $file_extension . '_' . Crypt::hashBase64($data) . '.' . $file_extension;
  $uri = $path . '/' . $filename;
  return $this->dumpToUri($data, $file_extension, $uri);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.