2013-08-22 5 views

답변

3

내가 발견 https://github.com/bjyoungblood/BjyAuthorize/blob/master/docs/unauthorized-strategies.md

namespace MyApp; 

use BjyAuthorize\View\RedirectionStrategy; 

class Module 
{ 
    public function onBootstrap(EventInterface $e) { 
     $application = $e->getTarget(); 
     $eventManager = $application->getEventManager(); 

     $strategy = new RedirectionStrategy(); 

     // eventually set the route name (default is ZfcUser's login route) 
     $strategy->setRedirectRoute('my/route/name'); 

     // eventually set the URI to be used for redirects 
     $strategy->setRedirectUri('http://example.org/login'); 

     $eventManager->attach($strategy); 
    } 
} 

이 작품을!

0

'unauthorized_strategy' => 'BjyAuthorize\View\RedirectionStrategy' 

bjyauthorize.global.php에 추가 한 다음 module.php에서

 use BjyAuthorize\View\RedirectionStrategy; 
     $strategy = new RedirectionStrategy(); 
     $strategy->setRedirectRoute('zfcuser/login'); 
     $eventManager->attach($strategy);