Bootstrap.php
protected function initRoutes(Application $app, $module)
    {
        $config = [
            'class' => GroupUrlRule::class,
            'rules' => $module->routes,
        ];

        $rule = Yii::createObject($config);
        $app->getUrlManager()->addRules([$rule], false);

        Yii::$app->user->loginUrl = $module->loginUrl;
    }
protected function initRoutes(Application $app, $module)
    {
        $config = [
            'class' => GroupUrlRule::class,
            'rules' => $module->routes,
        ];

        $rule = Yii::createObject($config);
        $app->getUrlManager()->addRules([$rule], false);

        Yii::$app->user->loginUrl = $module->loginUrl;
    }
Init routes
@param Application $app
@param Module $module
@throws InvalidConfigException