/** * {@inheritdoc} */ public function getRelativeUrl(UrlInterface $ref_url = null) { if (is_null($ref_url)) { return $this->path->getUriComponent() . $this->query->getUriComponent() . $this->fragment->getUriComponent(); } elseif ($this->getBaseUrl() != $ref_url->getBaseUrl()) { return $this->__toString(); } return $this->path->getRelativePath($ref_url->getPath()) . $this->query->getUriComponent() . $this->fragment->getUriComponent(); }
/** * {@inheritdoc} */ public function getRelativeUrl() { $path = $this->path->getUriComponent(); $query = $this->query->getUriComponent(); $fragment = $this->fragment->getUriComponent(); if ('' == $path) { $path = '/' . $path; } return $path . $query . $fragment; }
/** * Retuns a array representation like parse_url * But includes all components * * @return array */ public function toArray() { return array('scheme' => $this->scheme->get(), 'user' => $this->user->get(), 'pass' => $this->pass->get(), 'host' => $this->host->get(), 'port' => $this->port->get(), 'path' => $this->path->get(), 'query' => $this->query->get(), 'fragment' => $this->fragment->get()); }