I need to give current page url and change action url. After that I want echo that in view file. I want do these in view file, not controller!
Do you have any idea?
I need to give current page url and change action url. After that I want echo that in view file. I want do these in view file, not controller!
Do you have any idea?
If your current scope is a controller action, you can do this:
You can get current page url as follows:
The view helper
$this->userAgent()
returns an instance ofZend_Http_UserAgent
that can provide you with many useful info.If you want to get an action in your views you can get it as follows:
Not sure what you mean by 'changing an action'. You want to change it when you echo it, or you want to redirect user. Anyway, hope this will help.
Late to the party for sure, but the following worked for me in a Zend 1 project:
If you're echoing out the (user supplied) URL on the page, it's a good idea to use htmlspecialchars() to avoid someone sending your users to
http://example.com/?q=<script>nastyBusiness()</script>
.Don't forget protocol(in this example
http://
) if you are going to use$fullUrl
forhref
attributes