Exemple #1
0
 private function formTarget(IUri $uri)
 {
     $target = $uri->getPath();
     if ($query = $uri->getQuery()) {
         $target .= '?' . $query;
     }
     return $target;
 }
Exemple #2
0
 public function build(Http\Contract\IUri $uri, array $args = [])
 {
     if ($uri->getScheme() == 'route') {
         $resolved = $this->router->resolve($uri->getPath(), $args);
         $uri = Http\Uri::createFromString($resolved->path());
         $args = $resolved->arguments();
     }
     if (!$uri->getScheme()) {
         $uri = $this->base_url->withPath($uri->getPath());
     }
     return $uri->withQuery(http_build_query($args));
 }