0
votes

I have a problem with CakePHP (newest version) themes. I have created new theme to /app/View/Themed/Start/

and it contains default.ctp inside the Start folder.

I have edited /app/Controller/AppController.php and I placed this code inside it:

    class ThemeController extends AppController {
    public $theme = 'Start';
}

But it still uses the default layout instead of my own template. What am I doing wrong here?

1
You'll have to put the default.ctp inside the 'Layouts' folder inside your theme folder; e.g. app/View/Themed/Start/Layouts/default.ctp book.cakephp.org/2.0/en/views/themes.html - thaJeztah
@thaJeztah quite likely - make an answer for some reputation :) - AD7six
That doesn't work either, I put the default.ctp to /app/View/Themed/Start/Layouts but it still takes the layout from /app/View/Layouts/ - Mika Saarinen
Are you using scaffolding? Is debug enabled? - thaJeztah
I am having the same problem. Did you ever figure this out? - styks

1 Answers

0
votes

That code shouldn't be placed in AppController (Or anywhere for that matter) all you simply need to do is set the theme in AppController like this:

class AppController extends Controller {
    public $theme = 'Start';

It will then take your view files from app/View/Themed/Start