开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜