Yii Framework Theme-Manager class, switch themes by regular expressions on controller routes.
PHP
Latest commit 0ca49fb Jul 23, 2014 @schmunk42 Merge pull request #2 from motin/patch-2
Fixed variable typo
Permalink
Failed to load latest commit information.
EMultiThemeManager.php Fixed variable typo Jul 23, 2014
README.md updated README Apr 5, 2013
composer.json updated description Apr 5, 2013

README.md

multi-theme

Features

Yii Framework Theme-Manager class, switch themes by regular expressions on controller routes.

Download

Get it from github and place it into your application.

or

Via composer: composer.phar require schmunk42/multi-theme

Usage

Configuration Example

'themeManager' => array(
    'class' => 'vendor.schmunk42.multi-theme.EMultiThemeManager',
    'rules' => array(
        '^p3(.*)'                   => 'backend',  // use backend theme for all routes starting with p3
        '^user/default/index'       => 'frontend', // use frontend theme for several routes of the user module
        '^user/login/(.*)'          => 'frontend',
        '^user/profile/(.*)'        => 'frontend',
        '^user/registration/(.*)'   => 'frontend',
        '^user/recovery/(.*)'       => 'frontend',
        '^user/activation/(.*)'     => 'frontend',
        '^user/(.*)'                => 'backend',  // use backend theme for user module
        '^rights/(.*)'              => 'backend',  // use backend theme for rights module
    )
),

Note: The first matching rule wins.

Resources