Monday, 9 September 2013

Get request parameters in controller's constructor Zend Framework 2

Get request parameters in controller's constructor Zend Framework 2

I have 10 actions in one Controller. Every action required ID from
request. I want to check ID in constructor for every action, so I want
avoid to write the same code 10 times in every action.
obviously, In constructor I can not use functions like:
$this->params()->fromQuery('paramname'); or
$this->params()->fromRoute('paramname');
So, the question is how to get request params in controller's constructor?

No comments:

Post a Comment