I have two modules (default and mobile) the module mobile is a rewrite the default portal in jquery mobile but with much less controllers and actions! I thought of write a controller plugin that check if controller and action exist in module mobile, if not I would like overwrite the module mobile to default. I try this:
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
$dispatcher = Zend_Controller_Front::getInstance()->getDispatcher();
if ($request->getModuleName() == 'mobile') {
if (!$dispatcher->isDispatchable($request)) {
// Controller or action not exists
$request->setModuleName('default');
}
}
return $request;
}
but $dispatcher->isDispatchable($request)
return always true
though the action not exist! :S
and i receive "Action foo
does not exist and was not trapped in __call()"
How can I do? Thanks
Have you ever wondered how to check if a controller/action exist in zend FM from any side of app ? Here is the code
EDIT
Check like this way
and also please see detail link