码迷,mamicode.com
首页 > Web开发 > 详细

zf2 module.php中实现redirect

时间:2015-01-12 19:23:15      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:redirect   zend   zf2   

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.

zf2 module.php中实现redirect

标签:redirect   zend   zf2   

原文地址:http://blog.csdn.net/wang_quan_li/article/details/42645107

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!