Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can View helper read request

In an action helper, I can get request using $this->getRequest();

Anything similar for a view helper?

like image 786
jarn Avatar asked Apr 07 '11 11:04

jarn


1 Answers

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.

like image 173
Jake N Avatar answered Sep 30 '22 05:09

Jake N