views:

281

answers:

1

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.

+2  A: 

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();
farzad