コード例 #1
0
 static function HTML($name)
 {
     $path = Server::getSiteRoot();
     if (ResourceConfig::$addCachePrefixJs && static::PATH == 'js' || ResourceConfig::$addCachePrefixCss && static::PATH == 'css') {
         $path .= ResourceConfig::$addCachePrefix . '/';
     }
     $path .= $name . '.' . static::FileTime($name) . '.' . static::PATH;
     return static::_HTML($path);
 }
コード例 #2
0
ファイル: Scope.php プロジェクト: splitice/radical-web
 /**
  * Convert an object or string reference to a URL that will work.
  * 
  * @param mixed $object
  * @throws \Exception
  * @return string
  */
 function url($object, $param = null)
 {
     if (is_object($object)) {
         $object = $object->toURL($param);
     }
     if (!is_string($object)) {
         throw new \Exception('Unknown type to URLify: ' . gettype($object));
     }
     //Check for a full 'schemed' URL
     $first_part = substr($object, 0, 6);
     if ($first_part == 'http:/' || $first_part == 'ftp://' || $first_part == 'https:') {
         return $object;
         //URL is full
     }
     //Is relative? Make siterooted
     if ($first_part[0] != '/') {
         $object = \Radical\Core\Server::getSiteRoot() . $object;
     }
     return $object;
 }