Symfony\Component\HttpFoundation\Request::getSchemeAndHttpHost PHP Method

getSchemeAndHttpHost() public method

If the URL was called with basic authentication, the user and the password are not added to the generated string.
public getSchemeAndHttpHost ( ) : string
return string The scheme and HTTP host
    public function getSchemeAndHttpHost()
    {
        return $this->getScheme().'://'.$this->getHttpHost();
    }

Usage Example

 /**
  * @param Domain $domain
  * @param Request $request
  *
  * @return array
  */
 protected function buildSitemapLinks(Domain $domain, Request $request)
 {
     $links = [];
     if (!$domain->hasYearSpecificDomain()) {
         $links[$request->getSchemeAndHttpHost()] = $request->getSchemeAndHttpHost();
     }
     if ($domain->hasYearSpecificDomain()) {
         foreach ($this->months as $key => $value) {
             $links["{$request->getSchemeAndHttpHost()}/{$key}"] = "{$request->getSchemeAndHttpHost()}/{$key}";
         }
     }
     return $links;
 }
All Usage Examples Of Symfony\Component\HttpFoundation\Request::getSchemeAndHttpHost