I would like to get all of the base url of the site in my twig extension:
$this->service_container->get('request')->getBaseUrl()
gives me a lot but the host is missing...
another method maybe to get everything or one to get the host ?
Goal : have this :
http://my_host/request_base_url
$request = $this->getRequest();
$scheme = $request->getScheme();
$host = $request->getHttpHost();
$base = sprintf('%s://%s', $scheme, $host);
This is how im using this code to get complete base url .
public function test($request){
$baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath() ;
}