public function onBootstrap($e) { $e->getApplication()->getEventManager()->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch', function($e) { $controller = $e->getTarget(); if (something.....) { $controller->plugin('redirect')->toRoute('yourroute');
$controller->plugin('redirect')->to
Url($url);
} }, 100);}
For mor info visit http://framework.zend.com/manual/2.1/en/modules/zend.event-manager.event-manager.html.
zf2 module.php中实现redirect
最新推荐文章于 2021-04-01 01:17:37 发布