I’m using ZendFramework 1.11.11 for my application and I need know the URL (more specifically the path) that fire up my controller inside my controller.
When I try
$this->getFrontController()->getBaseUrl();
an empty string is returned. I test that code with the default application created by ZendStudio and accessing it typing http://test.com/default/index/index and nothing.
Any idea how get the URL that fireup a controller inside the controller?
The base url is the offset from the original slash that you’ve set up in your configuration. You do not have a base url, as default is the name of the module, index is the controller, and index is the action.
For firing up another controller, check out this link http://framework.zend.com/manual/en/zend.controller.action.html#zend.controller.action.utilmethods
To get the current path in a Zend fashion from a controller, do the following.