get base url in action controller to generate mail body in zend
I am creating a mail bo开发者_JAVA技巧dy for activating an account, In a controller action I want to get root url to generate a link for activation.I have used $this->getFrontController()->getBaseUrl()
this is giving '/public' not the complete url.Plz help.
Thanks
You could use url view helper to generate urls, if you want. If not you can get full baseUrl in an action as follows:
$fullBaseUrl = $this->view->serverUrl() . $this->view->baseUrl();
var_dump($fullBaseUrl);
精彩评论