Build the route.

@param   array   An array of URL arguments

@return array The URL arguments to use to assemble the subsequent URL.
197366
public function build(&$query)
    {
        if (isset($query['alias']) && isset($query['id'])) {
            $query['id'] = $query['id'].'-'.$query['alias'];
            unset($query['alias']);
        }

        $segments = array();

        if (isset($query['oid'])) {
            if ($query['oid'] == 'viewer') {
                $query['oid'] = get_viewer()->uniqueAlias;
            }
            $segments[] = '@'.$query['oid'];
            unset($query['oid']);
        }

        $segments = array_merge($segments, parent::build($query));

        return $segments;
    }
695252
public function buildUrlQuery(array $urlQueryArray = []): string
    {
        $params = [];
        foreach ($urlQueryArray as $key => $value) {
            $params[] = $key . '=' . $value;
        }

        return '?' . implode('&', $params);
    }
207229
public function addRoute(array $routeArray)
    {
        $routeKeys = array_keys($routeArray);
        $routeValues = array_values($routeArray);

        $routeName = reset($routeKeys);
        $route = reset($routeValues);

        $this->routes[$routeName] = $route;

        return $this;
    }
200283
static function buildUrl($parts)
    {
        $parts = new ArrayObject($parts);

        ###################
        ### PARSE PARTS ###
        ###################

        // scheme
        $scheme = $parts->key('scheme', '', true);

        // host
        $host = $parts->key('host', '', true);

        // port
        $port = $parts->key('port', '', true);

        // path
        $path = $parts->key('path', '', true);

        // parse query string
        $query = '';
        if($parts->keyExists('query')) {
            if(self::isString($parts->key('query'))) {
                parse_str($parts->key('query'), $queryData);
            } else {
                $queryData = $parts->key('query');
            }

            if(self::isArray($queryData)) {
                $query = $queryData;
            }
        }


        ###################
        ### BUILD URL   ###
        ###################
        $url = '';

        // scheme
        if($scheme && $scheme != '') {
            $url .= $scheme . '://';
        }

        // host
        if($host && $host != '') {
            $url .= $host;
        }

        // port
        if($port != '') {
            $url .= ':' . $port;
        }

        // path
        if($path != '') {
            $url .= $path;
        }

        // query
        if(self::isArray($query)) {
            $query = http_build_query($query);
            if($query != "") {
                $url .= '?' . $query;
            }
        }

        try {
            return new UrlObject($url);
        } catch (\Exception $e) {
            throw new UrlObjectException($e->getMessage());
        }
    }
908332
public static function build_query_string()
	{
		$params = array();

		foreach (func_get_args() as $arg)
		{
			$arg = is_array($arg) ? $arg : array($arg => '1');

			$params = array_merge($params, $arg);
		}

		return http_build_query($params);
	}
1198638
public function build()
    {
        if (!$this->build)
        {
            $this->build = $this->slice->make(
                $this->routes()
            );
        }

        return $this->build;
    }
70799
public function createUrl($params=array())
    {
        return Yii::app()->createUrl($this->route, CMap::mergeArray($params, $this->evaluateParams($this->params)));
    }
790953
protected function buildParams($arr = null, $force_key = false)
  {
    if (is_null($arr)) {
      $arr = $this->getParameters();
    }

    if (empty($arr)) {
      return false;
    }

    $out = '';
    foreach ($arr as $key => $val) {
      if (is_array($val)) {
        $out .= $this->buildParams($val, $key);
      } else {
        $out .= urlencode($force_key ?: $key) . ':' . urlencode($val) . '/';
      }
    }

    return $out;
  }
1001840
protected function addRoutes()
    {
		return ["Route::delete('" . $this->routeName . "/arr-delete', '" . $this->controller . "@arrDelete')->name('" . $this->myAddrName . ".arrDelete');\nRoute::resource('" . $this->routeName . "', '" . $this->controller . "');"];
    }
361662
public function build_array() {

		global $post;

		$breadcrumbs = array();

		// Not for 404 Not Found
		if ( ! is_404() ) {

			// Get post type data
			$post_type = get_post_type();
			$post_type_obj = get_post_type_object( $post_type );

			// Page Number
			$page_num = ctc_page_num();
			if ( $page_num > 1 ) {
				$this->add_breadcrumb( $breadcrumbs, array(
					sprintf( _x( 'Page %s', 'breadcrumb', 'church-theme-framework' ), $page_num ),
					$_SERVER['REQUEST_URI']
				) );
			}

			// Not on front page
			if ( ! is_front_page() ) {

				// Search Results
				if ( is_search() ) {
					$this->add_breadcrumb( $breadcrumbs, array(
						_x( 'Search Results', 'breadcrumb', 'church-theme-framework' ),
						get_search_link()
					) );
				}

				// Posts/Pages & Archives
				else {

					// Get post type data
					$post_type = get_post_type();

					// No post type found
					// Get post type via content type (section)
					$post_types = ctc_current_content_type_data( 'post_types' );
					if ( is_array( $post_types ) && 1 == count( $post_types ) && isset( $post_types[0] ) ) { // use section's post type if only one
						$post_type = $post_types[0];
					}

					// Get post type object
					$post_type_obj = get_post_type_object( $post_type );

					// Attachment
					if ( is_attachment() ) {

						/* translators: %s is mime type */
						$this->add_breadcrumb( $breadcrumbs, array(
							ctc_mime_type_name( $post->post_mime_type ),
							get_permalink()
						) );

						// Make parent(s) show, if any
						if ( ! empty( $post->post_parent ) ) {
							$parent_post_id = $post->post_parent;
						}

					}

					// Post or Page
					if ( ( is_singular() && ! is_attachment() ) || ! empty( $parent_post_id ) ) { // $parent_post_id can be attachment parent

						// Get post/page ID
						// Parent post (from attachment?) or current post
						$post_id = $post->ID;
						if ( ! empty( $parent_post_id ) ) {
							$post_id = $parent_post_id;
							$post_type = get_post_type( $post_id );
							$post_type_obj = get_post_type_object( $post_type );
						}

						// Show taxonomy before if has one
						// Use primary taxonomy's first term
						$taxonomies = get_object_taxonomies( $post_type );
						$taxonomy = isset( $taxonomies[0] ) ? $taxonomies[0] : false;
						if ( $taxonomy ) {
							$taxonomy_terms = get_the_terms( $post_id, $taxonomy );
							$taxonomy_term = is_array( $taxonomy_terms ) ? current( $taxonomy_terms ) : $taxonomy_terms; // use first term in list
						}

						// Post breadcrumb options
						$options = array();

							// Show parents only if not showing taxonomy
							if ( ! empty( $taxonomy ) ) {
								$options['show_parents'] = false; // default true
							}

						// Show post and parent(s)
						$this->add_breadcrumbs_array( $breadcrumbs, $this->post_breadcrumbs( $post_id, $options ) );

					}

					// Archives
					if ( is_archive() || ! empty( $taxonomy_term ) ) {

						// Blog Category
						if ( is_category() ) {
							$this->add_breadcrumbs_array( $breadcrumbs, $this->taxonomy_term_breadcrumbs( get_query_var( 'cat' ), 'category' ) );
						}

						// Blog Tag
						if ( is_tag() ) {

							// Get tag name
							$tag_data = get_term( get_query_var( 'tag_id' ), 'post_tag' );
							$tag_name = ! empty( $tag_data->name ) ? $tag_data->name : get_query_var( 'tag' );

							// Add tag to breadcrumb
							$this->add_breadcrumb( $breadcrumbs, array(
								$tag_name,
								get_tag_link( get_query_var( 'tag_id' ) )
							) );

						}

						// Custom Taxonomy and Parents
						if ( is_tax() || ! empty( $taxonomy_term ) ) { //  $taxonomy_term can come from post

							// Taxonomy passed in from post or are we on actual taxonomy?
							if ( is_tax() ) { // actual taxonomy
								$taxonomy = get_query_var( 'taxonomy' );
								$taxonomy_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
							}

							// Add taxonomies
							$this->add_breadcrumbs_array( $breadcrumbs, $this->taxonomy_term_breadcrumbs( $taxonomy_term, $taxonomy ) );

						}

						// Date Archive
						elseif ( is_year() || is_month() || is_day() ) {

							// Append date breadcrumbs
							$base_url = get_post_type_archive_link( $post_type );
							$this->add_breadcrumbs_array( $breadcrumbs, $this->date_breadcrumbs( $base_url ) );

						}

						// Author Archive
						elseif ( is_author() ) {
							$this->add_breadcrumb( $breadcrumbs, array(
								get_the_author(),
								get_author_posts_url( get_query_var( 'author' ) )
							) );
						}

					}

					// Post Type Archive
					// Single posts, taxonomies, etc.
					if ( $post_type_obj && ! is_page() ) { // not for pages

						// If static front page used and "Posts page" set, use that
						if ( 'post' == $post_type && $posts_page_id = get_option( 'page_for_posts' ) ) {
							$posts_page = get_page( $posts_page_id );
							$archive_name = $posts_page->post_title;
							$archive_url = get_permalink( $posts_page_id );
						}

						// Otherwise use current post type
						else {
							$archive_name = $post_type_obj->labels->name;
							$archive_url = get_post_type_archive_link( $post_type );
						}

						// Show only if have URL
						// When static front used and no "Posts page" set, there is no archive URL
						if ( $archive_url ) {
							$this->add_breadcrumb( $breadcrumbs, array(
								$archive_name,
								$archive_url
							) );
						}

					}

				}

			}

			// Add "Home" to front if have other breadcrumb(s)
			if ( ! empty( $breadcrumbs ) ) {
				$this->add_breadcrumb( $breadcrumbs, array(
					_x( 'Home', 'breadcrumbs', 'church-theme-framework' ),
					home_url( '/' )
				) );
			}

		}

		return apply_filters( 'ctc_breadcrumbs_array', $breadcrumbs );

	}
267443
public static function buildUrl(array $parts)
    {
        $url = $scheme = '';

        if (isset($parts['scheme'])) {
            $scheme = $parts['scheme'];
            $url .= $scheme . ':';
        }

        if (isset($parts['host'])) {
            $url .= '//';
            if (isset($parts['user'])) {
                $url .= $parts['user'];
                if (isset($parts['pass'])) {
                    $url .= ':' . $parts['pass'];
                }
                $url .=  '@';
            }

            $url .= $parts['host'];

            // Only include the port if it is not the default port of the scheme
            if (isset($parts['port'])
                && !(($scheme == 'http' && $parts['port'] == 80) || ($scheme == 'https' && $parts['port'] == 443))
            ) {
                $url .= ':' . $parts['port'];
            }
        }

        // Add the path component if present
        if (isset($parts['path']) && 0 !== strlen($parts['path'])) {
            // Always ensure that the path begins with '/' if set and something is before the path
            if ($url && $parts['path'][0] != '/' && substr($url, -1)  != '/') {
                $url .= '/';
            }
            $url .= $parts['path'];
        }

        // Add the query string if present
        if (isset($parts['query'])) {
            $url .= '?' . $parts['query'];
        }

        // Ensure that # is only added to the url if fragment contains anything.
        if (isset($parts['fragment'])) {
            $url .= '#' . $parts['fragment'];
        }

        return $url;
    }
509622
private function buildUserAgent($array)
    {
        $result = [];
        foreach ($array as $userAgent => $rules) {
            $rules = $this->arrayMergeRecursiveEx(self::TEMPLATE_SUB, $rules);
            $result = array_merge(
                $result,
                [self::DIRECTIVE_USER_AGENT . ':' . $userAgent],
                $this->buildString($rules[self::DIRECTIVE_ROBOT_VERSION], self::DIRECTIVE_ROBOT_VERSION),
                $this->buildVisitTime($rules[self::DIRECTIVE_VISIT_TIME]),
                $this->buildArray($rules[self::DIRECTIVE_NO_INDEX], self::DIRECTIVE_NO_INDEX),
                $this->buildArray($rules[self::DIRECTIVE_DISALLOW], self::DIRECTIVE_DISALLOW),
                $this->buildArray($rules[self::DIRECTIVE_ALLOW], self::DIRECTIVE_ALLOW),
                $this->buildString($rules[self::DIRECTIVE_CRAWL_DELAY], self::DIRECTIVE_CRAWL_DELAY),
                $this->buildString($rules[self::DIRECTIVE_CACHE_DELAY], self::DIRECTIVE_CACHE_DELAY),
                $this->buildRequestRate($rules[self::DIRECTIVE_REQUEST_RATE]),
                $this->buildArray($rules[self::DIRECTIVE_COMMENT], self::DIRECTIVE_COMMENT)
            );
        }
        return $result;
    }
1292738
public function buildUrl($url, array $query)
	{
		if (empty($query)) {
			return $url;
		}

		$parts = parse_url($url);

		$queryString = '';
		if (isset($parts['query']) && $parts['query']) {
			$queryString .= $parts['query'].'&'.http_build_query($query);
		} else {
			$queryString .= http_build_query($query);
		}

		$retUrl = $parts['scheme'].'://'.$parts['host'];
		if (isset($parts['port'])) {
			$retUrl .= ':'.$parts['port'];
		}

		if (isset($parts['path'])) {
			$retUrl .= $parts['path'];
		}

		if ($queryString) {
			$retUrl .= '?' . $queryString;
		}

		return $retUrl;
	}
454223
public function buildParameter(array $params)
	{
		$path = '';

		foreach ($params as $param)
		{
			$path .= $param;

			if (next($params) == true)
			{
				$path .= '|';
			}
		}

		return $path;
	}
640370
protected function buildPath()
    {
        $urlParameters = array();

        $parameters = get_object_vars($this);

        foreach ($parameters as $parameterName => $parameterValue) {
            if (true === is_null($parameterValue)) {
                continue;
            }
            if ($parameterName === 'apiKey') {
                $parameterName = 'api_key';
            }

            $urlParameters[] = $this->getPathPartForParameter($parameterName, $parameterValue);
        }

        return implode('&', $urlParameters);
    }
1308545
private function assembleRouteParams() : array
    {
        $params = [
            'version' => $this->version,
            'resource' => $this->resource,
        ];

        if ($this->id !== null) {
            $params['id'] = $this->id;
        }

        if ($this->relationship !== null) {
            $params['relationship'] = $this->relationship;
        }

        if ($this->relatedId !== null) {
            $params['parameter'] = $this->relatedId;
        }

        return $params;
    }
400900
public function _buildUrl($path = "", $queryStrings = [], $domain = "")
    {
        $queryString = "";
        foreach ($queryStrings as $key => $value) {
            if (is_array($value)) {
                continue;
            }

            $queryString .= "&{$key}={$value}";
        }
        if (strlen($queryString) > 0) {
            $queryString = "?" . substr($queryString, 1);
        }

        if ($domain == "") {
            $domain = $this->options['base_uri'];
        }

        $path = "/" . trim($path, "/") . "/";

        return "{$domain}{$this->domain}/{$this->options['version']}{$path}{$queryString}";
    }