1
votes

In my AppController i'm assigning the active theme like this:

$this->viewBuilder()->theme($this->Themes->active_theme());

I've created a page which shows all my themes (I'm using a json file for this), i want to add a preview theme functionality to every theme in my page just like wordpress, drupal etc.

I'm not sure how to can i temporarily load a theme using app controller for previewing purpose.

Any help on how this functionality works and how can i do it in Cakephp would save my day.

1
Do you want the other theme to be applied when a GET-parameter is present? Or when should the preview theme be applied? - MBosman
@MBosman Whenever user clicks the preview button the current loaded theme must not be changed rather a temporary preview must be loaded just like we do in wordpress. - Subhan

1 Answers

-1
votes

In your preview function, call $this->viewBuilder()->theme($previewTheme);? Seems pretty straight-forward, am I missing something?