/** * Get the absolute URL. * * @param string $base_url Use this url as base url * * @return string */ public function getAbsoluteUrl($base_url = '') { if ($base_url) { $base = new self($base_url); $url = $base->getAbsoluteUrl() . substr($this->getFullPath(), 1); } else { $url = $this->hasHost() ? $this->getBaseUrl() . $this->getFullPath() : ''; } return $url; }