首页 >后端开发 >php教程 >zf2 module.php中实现redirect

zf2 module.php中实现redirect

WBOY
WBOY原创
2016-06-23 13:41:522225浏览

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');            <pre class="n">$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.
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn