1

attribute*\vendor\bjyoungblood\bjy-authorize\src\BjyAuthorize\View\RedirectionStrategy.phpの値を変更するためにクラス RedirectionStrategy をオーバーライドするにはどうすればよいですか?$redirectRoute

http://pastebin.com/pPKsZcC5

まず、この投稿に従います: BjyAuthorizeでログインページにリダイレクトする方法

ありがとうございました!!

4

2 に答える 2

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);
    }
}

効きます!

于 2013-08-23T10:13:24.197 に答える