ZF\Apigility\Module::onBootstrap PHP Метод

onBootstrap() публичный Метод

- Attaches UnauthenticatedListener to authentication.post event. - Attaches UnauthorizedListener to authorization.post event. - Attaches module render listener to render event.
public onBootstrap ( MvcEvent $e ) : void
$e Zend\Mvc\MvcEvent
Результат void
    public function onBootstrap(MvcEvent $e)
    {
        $app = $e->getApplication();
        $services = $app->getServiceManager();
        $events = $app->getEventManager();
        $events->attach(MvcAuthEvent::EVENT_AUTHENTICATION_POST, $services->get(MvcAuth\UnauthenticatedListener::class), 100);
        $events->attach(MvcAuthEvent::EVENT_AUTHORIZATION_POST, $services->get(MvcAuth\UnauthorizedListener::class), 100);
        $events->attach(MvcEvent::EVENT_RENDER, [$this, 'onRender'], 400);
    }