Publish Different Assets (Css/js) According To Theme

Dear everyone,

My question

When we select different theme. How can we make Yii select a different asset file to publish according to theme.

Default theme

In config file…











When I call…


Yii publishes file normally.

But when I change theme into some other theme than default, how can I tell Yii to use different file to publish?

My workaround

I manually alter the package array before Yii renders the page

Yii::app()->clientScript->packages['myPackage'] = array(...) // Whatever new config for the theme I want it to be

But I think there has to be a better way… to do it in config file.