In an action helper, I can get request using $this->getRequest();
Anything similar for a view helper?
You can use
Zend_Controller_Front::getInstance()->getRequest()
To get the front controller and then the request from that within your view.
Although you should be using the controller to take the request and then pass on the correct data to the view. The view should be independent of the request and decoupled via the controller. Doing this basically breaks the MVC implementation of Zend Framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With