如何使用ZF提取完整的URL(子域,域和目录)?

Is there a way, using the functionality in ZF, to get the full url
(http[s]::/xxx.yyyy.ddd/ggg/hhh)

I am currently in?
baseUrl() will only give me the path, not the domain and sub domain.

I know how to extract it from the $_SERVER, trying to avoid that.

Use getRequest() method of your controller to get an instance of Zend_Controller_Request_Http object. then try the getHttpHost() method of the request object. so in your controller, it would be like this:

$hostName = $this->getRequest()->getHttpHost();

Construct your full URL like the following:

$this->getRequest()->getScheme() . '://' . $this->getRequest()->getHttpHost() . $this->getRequest()->getRequestUri();