may help you . I would not recommend doing it in the bootstrap file. The purpose of the bootstrap file is very specific in the Zend Application. Why don't you try using a plugin that will run during the pre-Dispatch. That is before the dispatching of the Controller Action of your choice?
PHP Zend Framework - How to Get Request URI Fragment from Request Object?
How to get the Request Object from a Model using Zend Framework.
I wish this help you Yes there is, but you are doing it wrong. For the purposes of answering the question this is how you do it....(but don't). You should pass the param to your model, rather than getting the param. How to get the Request from Anywhere
wish of those help I'm developing a RESTful application and I want to build a factory that creates the proper ViewModel (Zend\View\Model\ViewModel, Zend\View\Model\JsonModel, my XmlModel) object dependent on the Accept (e.g. -H 'Accept: application/json') parameter in the HTTP request header. I want to implement this as a callback: , The short answer: the request is registered as Request:
$request = $serviceManager->get('Request');
class SomeController extends AbstractActionController
protected $acceptCriteria = array(
'Zend\View\Model\JsonModel' => array(
'My\View\XmlModel' => array(
public function apiAction()
$model = $this->acceptableViewModelSelector($this->acceptCriteria);
Zend Framework - Getting request object in bootstrap