Generates a new route!
<p>
If there is something to generate with parameters, the route
needs the same number of '*' in it.

@param route route to navigate to
@param parms parameters of the route
@return generate String of new route
323319
public String generate(String route,
                         String... parms) {
    StringBuilder sb = new StringBuilder();
    String routeValue = route;
    if (routeValue.startsWith("/")) {
      routeValue = routeValue.substring(1);
    }
    String[] partsOfRoute = routeValue.split("/");

    int parameterIndex = 0;
    for (String s : partsOfRoute) {
      sb.append("/");
      if ("*".equals(s) || s.startsWith(":")) {
        if (Nalu.isUsingColonForParametersInUrl()) {
          sb.append(":");
        }
        if (parms.length - 1 >= parameterIndex) {
          sb.append(parms[parameterIndex].replace("/",
                                                  AbstractRouter.NALU_SLASH_REPLACEMENT));
          parameterIndex++;
        }
      } else {
        sb.append(s);
      }
    }

    // in case there are more paraemters then placesholders, we add them add the end!
    long numberOfPlaceHolders = Stream.of(partsOfRoute)
                                      .filter("*"::equals)
                                      .count();
    if (parms.length > numberOfPlaceHolders) {
      String sbExeption = "Warning: route >>" +
                          route +
                          "<< has less parameter placeholder >>" +
                          numberOfPlaceHolders +
                          "<< than the number of parameters in the list of parameters >>" +
                          parms.length +
                          "<< --> adding Prameters add the end of the url";
      RouterLogger.logSimple(sbExeption,
                             1);
      for (int i = parameterIndex; i < parms.length; i++) {
        sb.append("/");
        if (Nalu.isUsingColonForParametersInUrl()) {
          sb.append(":");
        }
        if (!Objects.isNull(parms[parameterIndex])) {
          sb.append(parms[parameterIndex].replace("/",
                                                  AbstractRouter.NALU_SLASH_REPLACEMENT));
        } else {
          sb.append("null");
        }
        parameterIndex++;
      }
    }

    // remove leading '/'
    String generatedRoute = sb.toString();
    if (generatedRoute.startsWith("/")) {
      generatedRoute = generatedRoute.substring(1);
    }
    StringBuilder parameters = new StringBuilder();
    for (int i = 0; i < parms.length; i++) {
      parameters.append(parms[i]);
      if (parms.length - 1 < i) {
        parameters.append(",");
      }
    }
    String sblog = "generated route >>" + generatedRoute + "<< -> created from >>" + route + "<< with parameters >>" + parameters + "<<";
    RouterLogger.logSimple(sblog,
                           1);
    return generatedRoute;
  }
970717
protected static function dynamic($route)
    {
        $parms = [];
        $param = '';
        $open = false;
        //
        for ($i = 0; $i < Strings::length($route); $i++) {
            if ($open && $route[$i] != '}') {
                $param .= $route[$i];
            }
            //
            if ($route[$i] == '{' && !$open) {
                $open = true;
            } //
            elseif ($route[$i] == '}' && $open) {
                $open = !true;
                $parms[] = $param;
                $param = '';
            }
        }
        //
        return $parms;
    }
333930
public static RouteImpl create(final String path, final Route route) {
        return create(path, DEFAULT_ACCEPT_TYPE, route);
    }
516781
public function dispatch(\Parable\Routing\Route $route)
    {
        $this->dispatchedRoute = $route;

        $this->hook->trigger(self::HOOK_DISPATCH_BEFORE, $route);
        $controller = null;

        // Start output buffering and set $returnContent to null
        $returnContent = null;
        $this->response->startOutputBuffer();

        // Build the parameters array
        $parameters = [];
        foreach ($route->getValues() as $value) {
            $parameters[] = $value;
        }

        // Call the relevant code
        if ($route->hasControllerAndAction()) {
            $controller = \Parable\DI\Container::get($route->getController());
            $returnContent = $controller->{$route->getAction()}(...$parameters);
        } elseif ($route->hasCallable()) {
            $callable = $route->getCallable();
            $returnContent = $callable(...$parameters);
        }

        $this->hook->trigger(self::HOOK_DISPATCH_TEMPLATE_BEFORE, $route);

        // If the route has no template path, attempt to build one based on controller/action.phtml
        if (!$route->hasTemplatePath() && $route->hasControllerAndAction()) {
            $reflection = new \ReflectionClass($controller);
            $controllerName = str_replace('\\', '/', $reflection->getName());
            $controllerName = str_replace('Controller/', '', $controllerName);

            $templatePathGenerated = $this->path->getDir(
                "app/View/{$controllerName}/{$route->getAction()}.phtml"
            );

            if (file_exists($templatePathGenerated)) {
                $route->setTemplatePath($templatePathGenerated);
            }
        }

        // And check again, now that we might have a magic template path
        if ($route->hasTemplatePath()) {
            $templatePath = $this->path->getDir($route->getTemplatePath());
            $this->view->setTemplatePath($templatePath);
            $this->view->render();
        }

        // If the callback or controller/action returned content, we need to handle it
        if ($returnContent) {
            if ($this->response->getOutput()->acceptsContent($returnContent)) {
                $this->response->setContent($returnContent);
            } else {
                $type   = gettype($returnContent);
                $output = get_class($this->response->getOutput());

                // Stop the output buffer we've started above and throw
                $this->response->stopOutputBuffer();
                throw new \Parable\Framework\Exception(
                    "Route returned value of type '{$type}', which output class '{$output}' cannot handle."
                );
            }
        }

        // Any rendered content was from before the returnContent was set, so we prepend it if there's any
        $renderedContent = $this->response->returnOutputBuffer();
        if ($renderedContent) {
            $this->response->prependContent($renderedContent);
        }

        $this->hook->trigger(self::HOOK_DISPATCH_TEMPLATE_AFTER, $route);
        $this->hook->trigger(self::HOOK_DISPATCH_AFTER, $route);
        return $this;
    }
1279768
function getRouteParams(route, params) {
  var routeParams = {};

  if (!route.path) return routeParams;

  (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {
    if (Object.prototype.hasOwnProperty.call(params, p)) {
      routeParams[p] = params[p];
    }
  });

  return routeParams;
}
311297
public function dispatchRoute(Parsed $route, array $parameters = [])
    {
        $handler = $route->getHandler();
        if (isset($handler['controler']) && isset($handler['action'])) {
            $routePlaceholders             = $route->getPlaceholders();
            list($controllerName, $action) = $this->resolveControlerAction(
                $route->getParameters(),
                $routePlaceholders,
                $handler
            );

            // Create instance of target class
            $controller = new $controllerName();
            // Create class method name with prefix
            $methodName = $this->actionName.$action;

            $parameterMap = $this->getMethodParameters(
                $controllerName,
                $methodName
            );

            $methodParameters = $this->getFunctionArgumentsControlers(
                $parameterMap,
                $route->getParameters(),
                $routePlaceholders,
                $handler
            );

            return call_user_func_array(
                [
                    $controller,
                    $methodName
                ],
                $methodParameters
            );
        }

        return $this->dispatchNotFound();
    }
408652
protected function  generateUrl($route,array $parameters){
        return $this->container->get('router')->generate($route, $parameters, Router::ABSOLUTE_URL);
    }
348647
function createRoutes(routes) {
  if (isReactChildren(routes)) {
    routes = createRoutesFromReactChildren(routes);
  } else if (routes && !Array.isArray(routes)) {
    routes = [routes];
  }

  return routes;
}
27821
public void start(DirectionsRoute route) {
    if (route != null) {
      currentRouteInformation = buildRouteInformationFromRoute(route);
    }
    navigation.addProgressChangeListener(progressChangeListener);
  }
1323918
public static function fromRoute(Route $route, array $params = []): self
    {
        $result = new self();
        $result->success = true;
        $result->route = $route;
        $result->matchedParams = $params;

        return $result;
    }
608510
protected function createUrlDefault($route, $params, $ampersand)
    {
        if ($this->urlFormat === self::PATH_FORMAT) {
            $url = rtrim($this->getBaseUrl() . '/' . $route, '/');
            if ($this->appendParams) {
                $url = rtrim($url . '/' . $this->createPathInfo($params, '/', '/'), '/');
                return $route === '' ? $url : $url . $this->urlSuffix;
            } else {
                if ($route !== '') {
                    $url .= $this->urlSuffix;
                }
                $query = $this->createPathInfo($params, '=', $ampersand);
                return $query === '' ? $url : $url . '?' . $query;
            }
        } else {
            $url = $this->getBaseUrl();
            if (!$this->showScriptName) {
                $url .= '/';
            }
            if ($route !== '') {
                $url .= '?' . $this->routeVar . '=' . $route;
                if (($query = $this->createPathInfo($params, '=', $ampersand)) !== '') {
                    $url .= $ampersand . $query;
                }
            } elseif (($query = $this->createPathInfo($params, '=', $ampersand)) !== '') {
                $url .= '?' . $query;
            }
            return $url;
        }
    }
1179000
public static String newUrl(final String baseUrl, 
        final Collection<Pair<String, String>> params)
        {
        final StringBuilder sb = new StringBuilder();
        sb.append(baseUrl);
        sb.append(getUrlParameters(params, true));
        return sb.toString();
        }
893930
protected function generateLink($route, $params = null)
    {
        if ($route instanceof Closure) {
            // Have to stringify this before calling Route::has because it will
            // Fail if we don't pass a string in
            $route = $this->stringify($route);
        }
        if (\Route::has($route)) {
            // If params is empty, just don't call it...
            if (empty($params)) {
                return route($this->routify($route));
            } else { // Since $params isn't empty and $route is a Route, just paramify both.
                return route($this->routify($route), $this->routeparamify($params));
            }
        }

        if (empty($params)) {
            return url($this->routify($route));
        } else {
            // Since $params isn't empty and $route is not Route, just paramify both anyway.
            return url($this->routify($route), $this->routeparamify($params));
        }
    }
116485
function ParamRoutePath(routePath) {
        this.routePath = routePath;
        this.terminal = true;
        this._assertValidPath(routePath);
        this._parsePathString(routePath);
        this.specificity = this._calculateSpecificity();
        this.hash = this._calculateHash();
        var lastSegment = this._segments[this._segments.length - 1];
        this.terminal = !(lastSegment instanceof ContinuationPathSegment);
    }
808568
public <Source extends RouteSource, Destination extends RouteDestination> RoutingBuilder add(Route<Source, Destination> route) {
        routes.add(route);
        return this;
    }
130155
private static String url(final Route route) {
		return route.getLinks().isEmpty()
			? null
			: route.getLinks().get(0).getHref().toString();
	}
737384
function _buildRoute(route) {

  let newRoute = route;

  // Normalize the route string
  newRoute = (newRoute.indexOf('/') === 0) ? newRoute.slice(1, newRoute.length) : newRoute;
  newRoute = '/' + newRoute;

  // Prepend the root if the user defined one
  newRoute = (Nasa.__config__['root']) ? Nasa.__config__['root'] + newRoute : newRoute;

  return newRoute;
}