How to get full url to accessed controller action in Zend php framework

Tuesday, 29th June 2010

I’ve recently wondered how I can get the full url address of a requested controller/action in Zend php framework.
After some tries I finally did it:

Here is how to achieve it:

$fullUrl = "http://". $this->getRequest()->getHttpHost() . $this->view->url();

Share this on:

Download PDFDownload PDF

Tags:

One Response to “How to get full url to accessed controller action in Zend php framework”

  1. Bruno says:
    Safari 5.1.1 Safari 5.1.1 Mac OS X 10.6.8 Mac OS X 10.6.8
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22

    exactly what I needed! Thanks for sharing!

    View CommentView Comment

Leave a Reply

CommentLuv badge