Elcodi\Plugin\StoreSetupWizardBundle\EventListener\DashboardRedirectionEventListener::handle PHP Method

handle() public method

Handles the event redirecting to the wizard if the user is visiting the dashboard
public handle ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent The response event
    public function handle(GetResponseEvent $event)
    {
        if ($this->plugin->isEnabled() && !$this->wizardStatus->isWizardFinished()) {
            $request = $event->getRequest();
            $currentRoute = $this->getCurrentRequestRoute($request);
            if ('admin_homepage' == $currentRoute) {
                $event->setResponse(new RedirectResponse($this->urlGenerator->generate($this->wizardRoutes->getDefaultWizardRoute())));
            }
        }
    }