コード例 #1
0
ファイル: Mapper.php プロジェクト: kidaa30/yes
 /**
  * Given the key, provides the path to file containing
  * extension's main class.
  *
  *
  * @param string $key
  *   Extension key.
  *
  * @return string
  *   url for resources in this extension
  */
 public function keyToUrl($key)
 {
     if ($key == 'civicrm') {
         // CRM-12130 Workaround: If the domain's config_backend is NULL at the start of the request,
         // then the Mapper is wrongly constructed with an empty value for $this->civicrmUrl.
         if (empty($this->civicrmUrl)) {
             $config = CRM_Core_Config::singleton();
             return rtrim($config->resourceBase, '/');
         }
         return $this->civicrmUrl;
     }
     return $this->container->getResUrl($key);
 }