public function toString($raw = false, $full = true)
{
if ($this->toStringCallback || !strlen($this->anchor)) {
$baseUrl = $this->_baseUrl->copy();
$baseUrl->parameters = array_merge($baseUrl->parameters, $this->parameters);
if (strlen($this->pathInfo)) {
$baseUrl->pathInfo = $this->pathInfo;
}
return $baseUrl->toString($raw, $full);
}
$url = $this->_baseUrl->toString($raw, $full);
if (strlen($this->pathInfo)) {
$url = rtrim($url, '/');
$url .= '/' . $this->pathInfo;
}
if ($this->anchor) {
$url .= '#' . ($raw ? $this->anchor : rawurlencode($this->anchor));
}
if ($params = $this->_getParameters()) {
$url .= '?' . implode($raw ? '&' : '&', $params);
}
return strval($url);
}