Merge pull request #11902 from mukeshcompucorp/fix-template-structure-issues
[civicrm-core.git] / Civi / Core / AssetBuilder.php
index 5c3c8263b072478e22200b67f57ee5c8862484da..5f79555650c9f0babfe3cd616be04ec12de79fb9 100644 (file)
@@ -139,6 +139,23 @@ class AssetBuilder {
     }
   }
 
+  /**
+   * @param string $name
+   *   Ex: 'angular.json'.
+   * @param array $params
+   * @return string
+   *   URL.
+   *   Ex: '/var/www/files/civicrm/dyn/angular.abcd1234abcd1234.json'.
+   */
+  public function getPath($name, $params = array()) {
+    if (!$this->isValidName($name)) {
+      throw new \RuntimeException("Invalid dynamic asset name");
+    }
+
+    $fileName = $this->build($name, $params);
+    return $this->getCachePath($fileName);
+  }
+
   /**
    * Build the cached copy of an $asset.
    *