ZF 1.9.6
Trying to change the module based on the user agent of the request.
When I try to get the request object from the Front, I get NULL.
Currently I’m trying to set the module name from the Bootstrap _initModule method I created.
$front = Zend_Controller_Front::getInstance();
$request = $front->getRequest(); // This is NULL
$request = new Zend_Controller_Request_Http();
$request->setModuleName('iphone');
$front->setRequest($request);
However, when executed, it’s still going to the ‘default’ module.
I don’t think Bootstrap is the right place, because it happens before any request routing starts.
I’d suggest using preDispatch front controller plugin for that:
With:
in you
application.ini