2017 © Pedro Peláez
 

yii2-extension thememanager

Theme manager for Yii2 (simple theme managment for Yii2)

image

singrana/thememanager

Theme manager for Yii2 (simple theme managment for Yii2)

  • Friday, March 11, 2016
  • by Singrana
  • Repository
  • 1 Watchers
  • 3 Stars
  • 293 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

Theme manager

Theme manager for Yii2, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist singrana/thememanager "*"

or add, (*4)

"singrana/thememanager": "*"

to the require section of your composer.json file., (*5)

Usage

Change your application config, (*6)

'view'=>
[

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

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

            ...
            ],
            ...
    ],
],

If you need to change theme, use:, (*7)

\Yii::$app->view->theme->changeTheme('themeName');

For dynamic create new theme:, (*8)

\Yii::$app->view->theme->createTheme('newTheme',
[
    'pathMap'           =>
    [
        '@app/views'            =>  '@app/themes/admin/views',
        '@app/views/layouts'    =>  '@app/themes/admin/layouts',
    ],
]);

and use new theme:, (*9)

\Yii::$app->view->theme->changeTheme('newTheme');

The Versions

11/03 2016

dev-master

9999999-dev

Theme manager for Yii2 (simple theme managment for Yii2)

  Sources   Download

MIT

The Requires

 

by Avatar Singrana

yii2 themes thememanager sinplatform