zf2 module.php中实现redirect
时间:2015-01-12 19:21:12
收藏:0
阅读:346
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‘)->toUrl($url);
} }, 100);}
For mor info visit http://framework.zend.com/manual/2.1/en/modules/zend.event-manager.event-manager.html.
原文:http://blog.csdn.net/wang_quan_li/article/details/42645107
评论(0)