zend: baseUrl view helper returns empty string
-
26-04-2021 - |
Question
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.
OTHER TIPS
Did you set the baseurl in your application.ini?
resources.frontController.baseUrl = "/subdir"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow