src/yimaTheme/Module.php
public function initThemeManager(ModuleEvent $e)
    {
        /** @var $moduleManager \Zend\ModuleManager\ModuleManager */
        $moduleManager = $e->getTarget();
        // $sharedEvents = $moduleManager->getEventManager()->getSharedManager();

        $sm = $moduleManager->getEvent()->getParam('ServiceManager');
        $themManager = $sm->get('yimaTheme.Manager');
        if (!$themManager instanceof ManagerInterface) {
            throw new \Exception(sprintf(
                    'yimaTheme theme manager most instance of "ManagerInterface" but "%s" given.'
                    , get_class($themManager)
            ));
        }

        $themManager->init();
    }
public function initThemeManager(ModuleEvent $e)
    {
        /** @var $moduleManager \Zend\ModuleManager\ModuleManager */
        $moduleManager = $e->getTarget();
        // $sharedEvents = $moduleManager->getEventManager()->getSharedManager();

        $sm = $moduleManager->getEvent()->getParam('ServiceManager');
        $themManager = $sm->get('yimaTheme.Manager');
        if (!$themManager instanceof ManagerInterface) {
            throw new \Exception(sprintf(
                    'yimaTheme theme manager most instance of "ManagerInterface" but "%s" given.'
                    , get_class($themManager)
            ));
        }

        $themManager->init();
    }
Get Theme Manager Service and init them

@param ModuleEvent $e
@throws \Exception