从后端yii2

时间:2016-08-18 14:18:47

标签: php yii2 yii2-advanced-app

我在前端https://github.com/Singrana/thememanager安装此插件用于更改主题 像手册一样安装。

在我的前端/ config / main.php

'components' => [
'view'=>
        [

        'theme' =>
            [
                'class'     =>  'singrana\thememanager\components\ThemeManager',
                'current'   =>  'siteeee',

                'themes'    =>
                [
                    'site'  =>
                    [
                        'pathMap'   =>
                        [
                            '@app/views'            =>  '@frontend/themes/site',
                            '@app/views/layouts'    =>  '@frontend/themes/site/layouts',
                        ],
                        //'defaultLayout'             =>  '//inner',
                    ],

                    'siteeee'  =>
                    [
                        'pathMap'   =>
                        [
                            '@app/views'            =>  '@frontend/themes/siteeee',
                            '@app/views/layouts'    =>  '@frontend/themes/siteeee/layouts',
                        ],
                        //'defaultLayout'             =>  '//inner',
                    ],

                ],
        ],
    ],

],

但我需要像手动一样调用\Yii::$app->view->theme->changeTheme('themeName');来更改主题,我该如何在后端执行此操作?

0 个答案:

没有答案