1

I've created a simple application that is about to be vastly expanded upon and get a bit out of hand if I don't get the theme sorted out early as I need to start working with tinyMCE.

I created my theme in app/View/Themed/Default and added the following into my app controller

public $theme = 'Default';

Something seems to be working because cakePHP is not rendering my views and is giving me the following errors.

Error: The view for {controller name}Controller::add() was not found.

Error: Confirm you have created the file: /home/cake/public_html/app/View/Themed/Default/{controller}/theme.ctp

I've been reading through the documentation and nowhere in there does it tell me that I need to create a folder for every controller and add a theme.ctp file inside. so I'm at a bit of a loss as to what needs to go into this theme.ctp file.

If I add the Controller folder, and a blank them.ctp file, the view is not rendered. So I am assuming something vital is required here.

Chris Morris
  • 943
  • 2
  • 17
  • 41

1 Answers1

0

I discovered the problem.

Further down the page from legacy code that was ported across, the following code was sitting at the bottom of the page.

AppController.php

function beforeRender() {
    $this->view = "Theme";
    $this->theme = "default";
}

So it was being forced into rendering a view that did not exist.

Chris Morris
  • 943
  • 2
  • 17
  • 41