/** * {@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; }
public function testPrepend() { $path = new Path('/toto/toto/shoky/master'); $path->prepend('foo', 'toto', 1); $this->assertSame('/toto/foo/toto/shoky/master', $path->getUriComponent()); }