Search code examples
zend-frameworkbase-url

zend: baseUrl view helper returns empty string


On my site, when I call $this->baseUrl() in a view, it returns an empty string. I would expect it to return e.g. http://www.foobar.com/. Do I need to manually set base url?

In manual to Zend_Application_Resource_Frontcontroller - configuration keys, I have just found this:

baseUrl: explicit base URL to the application (normally auto-detected)

Any ideas why it is not autodetected for me?


Solution

  • The baseUrl() helper returns the path to your Zend Application.

    Use the serverUrl() helper for the hostname.