0
votes

I need to create a separate theme in Cakephp which only changes one view file. But the fact is that this is already themed. There is some personalization in themes. Is there any way to create themes inside themes in CakePHP?

1

1 Answers

0
votes

No, but you can create parallel themes, and then just link your one view to the second theme. Let's say you have the following theme right now:

/app/View/Themed/MyTheme

...and you only want to change the view file for the Users::Login action which would be here:

/app/View/Themed/MyTheme/Users/login.ctp

Create a 2nd Theme Folder, and login.ctp which your overwrite your main theme file:

/app/View/Themed/MyOtherTheme/Users/login.ctp

Now in your Controller action, in this case UsersController::login(), change the theme being used for the action:

public function myFunction() {
  $this->theme = 'MyOtherTheme';
}