コード例 #1
0
ファイル: Resources.php プロジェクト: nganivet/civicrm-core
 /**
  * Determine public URL of a resource provided by an extension.
  *
  * @param string $ext
  *   extension name; use 'civicrm' for core.
  * @param string $file
  *   file path -- relative to the extension base dir.
  * @param bool $addCacheCode
  *
  * @return string, URL
  */
 public function getUrl($ext, $file = NULL, $addCacheCode = FALSE)
 {
     if ($file === NULL) {
         $file = '';
     }
     if ($addCacheCode) {
         $file .= '?r=' . $this->getCacheCode();
     }
     // TODO consider caching results
     return $this->extMapper->keyToUrl($ext) . '/' . $file;
 }
コード例 #2
0
 /**
  * Determine public URL of a resource provided by an extension.
  *
  * @param string $ext
  *   extension name; use 'civicrm' for core.
  * @param string $file
  *   file path -- relative to the extension base dir.
  * @param bool $addCacheCode
  *
  * @return string, URL
  */
 public function getUrl($ext, $file = NULL, $addCacheCode = FALSE)
 {
     if ($file === NULL) {
         $file = '';
     }
     if ($addCacheCode) {
         $file .= '?r=' . $this->getCacheCode();
     }
     // TODO consider caching results
     $base = $this->paths->hasVariable($ext) ? $this->paths->getVariable($ext, 'url') : $this->extMapper->keyToUrl($ext) . '/';
     return $base . $file;
 }