If the situations are just that you want certain pages to use certain themes, use the config/site_theme_paths.php file. Otherwise, you can use this code:
But note that this must occur before the theme starts to render... so it can't be in your theme templates or block views. I think you could put it in an on_page_view event somewhere.
But note that this must occur before the theme starts to render... so it can't be in your theme templates or block views. I think you could put it in an on_page_view event somewhere.