全站assets资源URL.

@param string $res
@param string $min
@param bool   $appendArg 是否添加参数

@return string
970134
public static function assets($res, $min = '', $appendArg = true) {
        static $static_url = false;
        if ($static_url === false) {
            $static_url = App::cfg('static_base');
            if ($static_url) {
                $static_url = trailingslashit($static_url . WWWROOT_DIR);
            } else {
                $static_url = WWWROOT_DIR;
            }
        }
        if (preg_match('#^(/|https?://).+$#', $res)) {
            return $res;
        }
        $url = ltrim($res, '/');
        if ($min || APP_MODE == 'pro') {
            $url1 = preg_replace('#\.(js|css)$#i', '.min.\1', $url);
            if (is_file(WWWROOT . ASSETS_DIR . '/' . $url1)) {
                $url = $url1;
            }
        }
        if ($appendArg) {
            return $static_url . ASSETS_DIR . '/' . $url . '?_ver=' . BUILD_NUMBER;
        } else {
            return $static_url . ASSETS_DIR . '/' . $url;
        }
    }
1328251
def _appendArgs(url, args):
    
    # to be merged with oidutil.appendArgs when we combine the projects.
    if hasattr(args, 'items'):
        args = list(args.items())
        args.sort()

    if len(args) == 0:
        return url

    # According to XRI Resolution section "QXRI query parameters":
    #
    # """If the original QXRI had a null query component (only a leading
    #    question mark), or a query component consisting of only question
    #    marks, one additional leading question mark MUST be added when
    #    adding any XRI resolution parameters."""

    if '?' in url.rstrip('?'):
        sep = '&'
    else:
        sep = '?'

    return '%s%s%s' % (url, sep, urlencode(args))
1340637
function appendUrl(url, urls) {
    var i = urls.length
        found = false;
    while (i--) {
        if (utils.compareUrl(urls[i], url)) 
          found = true; 
    }
    if (found === false && utils.isUrl(url)) 
      urls.push(url);
}
842089
public function get( array $args = [], array $assoc_args = [] ) {

		$site_id = (int) $args[ 0 ];
		$site    = get_blog_details( $site_id );
		if ( ! $site ) {
			WP_CLI::error( "A site with ID {$site_id} does not exist" );
		}

		// trailing-slash it, as URLs ends always with a trailing slash in context of the wp_blogs table
		WP_CLI::line( trailingslashit( $site->siteurl ) );
		exit( 0 );
	}
899699
public static function appendUrlParams($url,$appendParams=[])
    {
        if(empty($appendParams)){
            return $url;
        }
        $paramString="";
        foreach ($appendParams as $key => $value){
            $paramString.="&".$key."=".urlencode($value);
        }
        $paramString=substr($paramString, 1);

        $pos=strpos($url, "?");
        if($pos>0 || $pos===0){
            $url.="&".$paramString;
        }else{
            $url.="?".$paramString;
        }
        return $url;
    }
1258362
public function appendLink($sAddParams, $iLang = null)
    {
        if ($sAddParams) {
            if ($iLang === null) {
                $iLang = $this->getLanguage();
            }

            $this->_aSeoAddParams[$iLang] = isset($this->_aSeoAddParams[$iLang]) ? $this->_aSeoAddParams[$iLang] . "&amp;" : "";
            $this->_aSeoAddParams[$iLang] .= $sAddParams;
        }
    }
186085
public function absoluteUrl($uri = null, $args = null)
    {
        if (isset($uri)) {
            $uri = '/'. ltrim($uri, "/");
            return $this->baseUrl() . $this->url->get($uri, $args);
        } else {
            return $this->baseUrl() . $this->url->getBaseUri();
        }
    }
1078329
public function fullUrl($url = false, $omitProtocol = false, $omitBaseUrl = false) {
        if (!$url) {
            $url = $this->view->url();
        }
        $fullUrl = new Garp_Util_FullUrl($url, $omitProtocol, $omitBaseUrl);
        return $fullUrl->__toString();
    }
1350150
public function to_html($indent = 0, $extraargs = array()) {
        if (!$this->display) {
            return '';
        }
        $tabs = str_repeat("\t", $indent);

        if (isset($this->children)) {
            $childrenhtml = $this->children->to_html($indent+1, $extraargs);
        } else {
            $childrenhtml = '';
        }
        return $this->item_html($extraargs).'&nbsp;'.(join($this->icons, '')).(($childrenhtml !='')?("\n".$childrenhtml):'');
    }
1116121
def buildURL(self, action, **query):
        """"""
        base = urlparse.urljoin(self.server.base_url, action)
        return appendArgs(base, query)
611684
private function buildUrl($endpoint, $url_parameters = [], $special_url = null)
    {
        foreach ($url_parameters as $key => $value) {
            //@codeCoverageIgnoreStart
            $endpoint = str_replace('{'.$key.'}', $value, $endpoint);
            //@codeCoverageIgnoreEnd
        }

        if (is_null($special_url)) {
            $url = trim($this->api_base_url, "/ \t\n\r\0\x0B");
        } else {
            $url = $special_url;
        }
        $url = $url.'/'.trim($endpoint, "/ \t\n\r\0\x0B");

        return $url;
    }
471606
public static function webassets(array $params):string
    {
        return (FEnv::get("host.web.components.apps").strtolower(FEnv::get("framework.env")).
            "/".((isset($params['app']) && $params['app'] != "")? "min"."." :
                strtolower(FEnv::get("app.call")))."/".$params['path']);
    }
702204
function renderMarginsField( $args ) {
		unset( $args['label_for'], $args['class'] );
		?>
		<div class="margin-diagram">
			<p class="description"><?php echo $args[0]; ?></p>
			<div class="pages">
				<div class="page left">
					<div class="margin outside"></div>
					<div class="margin top"></div>
					<div class="margin inside"></div>
					<div class="margin bottom"></div>
				</div>
				<div class="page right">
					<div class="margin inside"></div>
					<div class="margin top"></div>
					<div class="margin outside"></div>
					<div class="margin bottom"></div>
				</div>
			</div>
			<div class="legend">
				<ul>
					<li class="outside"><span class="color"></span> <?php _e( 'Outside Margin', 'pressbooks' ); ?></li>
					<li class="inside"><span class="color"></span> <?php _e( 'Inside Margin', 'pressbooks' ); ?></li>
					<li class="top"><span class="color"></span> <?php _e( 'Top Margin', 'pressbooks' ); ?></li>
					<li class="bottom"><span class="color"></span> <?php _e( 'Bottom Margin', 'pressbooks' ); ?></li>
				</ul>
			</div>
		</div>
		<p>
			<strong><?php _e( 'IMPORTANT: If you plan to use a print-on-demand service, margins under 2cm on any side can cause your file to be rejected.', 'pressbooks' ); ?></strong>
		</p>
		<?php
	}
416087
private function build_asset_args( $asset ) {

		// setup default args for array type includes
		$args = array(
			'src'       => $asset,
			'deps'      => array(),
			'ver'       => false,
			'in_footer' => false,
			'media'     => false,
		);

		if ( is_array( $asset ) ) {
			$args = array_merge( $args, $asset );
		}

		// add uix dep
		$args['deps'][] = 'uix';

		return $args;
	}
864498
public function joinUrlParts() {
		if (0 === func_num_args()) {
			throw new \InvalidArgumentException('Need at least one argument');
		}

		$parts = func_get_args();
		$trimSlashes = function(&$part) {
			$part = trim($part, '/');
		};
		array_walk($parts, $trimSlashes);

		return implode('/', $parts);
	}
602953
public function buildUrl($controller, $action, array $args = array(), array $get = array())
    {
        $url = $this->buildDestination($controller, $action, $args);
        if (!$this->cleanUrlsEnabled()) {
            $url = $this->entryPoint.$url;
        }
        if ($get) {
            $url .= '?'.http_build_query($get);
        }

        return $url;
    }
284528
public static function makeUrl(string $append = null): string
    {
        if ($append == null) {
            return 'http' . (Application::isSSL() ? 's' : '') . '://' . Application::getDomain();
        } else {
            if (substr($append, 0, 1) != '/') {
                $append = '/' . $append;
            }
            return 'http' . (Application::isSSL() ? 's' : '') . '://' . Application::getDomain() . $append;
        }
    }