zf2 module.php中实现redirect

WBOY
Release: 2016-06-23 13:41:52
Original
2177 people have browsed it

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);
Copy after login

} }, 100);}
For mor info visit http://framework.zend.com/manual/2.1/en/modules/zend.event-manager.event-manager.html.
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!