0
votes

I'm begin with work with CakePHP 3 Themes. I know i can set Themes in the AppController in the beforeRender function of the Project with

$this->viewBuilder()->theme('ThemeName');

but now i want a button in my view to change the theme. I have this in my view

<?= $this->Html->link(('changeTheme'), ['action' => 'changeTheme']) ?>

and the function in my controller but what i must do to change the theme in the controller or generell at runtime.

1

1 Answers

0
votes

ok i fix this problem with a cookie. The cookie save a variable of a theme and in a if query in the beforeRender function do the action.