简体   繁体   中英

How to programmatically change theme in OctoberCMS?

I can change the active theme from the management dashboard in OctoberCMS by going to Settings/Front-end theme. Now I want to give the end-users the ability to change the theme by clicking on an icon. How can I change the theme programatically on the server side? I could not find the relevant code in the documents.

CLI command of enabling some theme is:

php artisan theme:use rainlab-vanilla

It means that you can call php code something like that:

Artisan::call('theme:use', ['rainlab-vanilla'])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM