1
votes

Hi I want to add a new layout to my cakephp, but somehow the system keeps looking in the view folder from the controller instead of the /app/View/Layouts folder.

Error: The view for TestsController::desktop() was not found.
Error: Confirm you have created the file: /app/View/Tests/desktop.ctp

the desktop.ctp file is in /app/View/Layouts. The same place as the default.ctp

The code in the controller is:

public function desktop() {

    $this->layout = 'desktop';
}

What is wrong here? I don't understand why cakephp keeps looking in the view/controller-name folder... I need this fixed because I want to use this layout for other controllers. Thanks.

1

1 Answers

2
votes

If you read the message carefully, you'll see cake is telling you it cannot find your view, not your layout.

So, create an empty /app/View/Tests/desktop.ctp and see what happens. I'm hoping magic.. :)