Example #1
0
 private function getVersionedFile($file, $buildDirectory = 'assets')
 {
     static $manifest = null;
     if (is_null($manifest)) {
         $manifest = json_decode(file_get_contents(Application::assetPath('rev-manifest.json')), true);
     }
     if (isset($manifest[$file])) {
         return DIRECTORY_SEPARATOR . $buildDirectory . DIRECTORY_SEPARATOR . $manifest[$file];
     }
     throw new \InvalidArgumentException('File ' . $file . ' not defined in asset manifest.');
 }