Question

According to the CakePHP 2.x cookbook:

By default app/Layouts/default.ctp layout is used for error pages.

If you want to use another layout app/Layouts/my_error.ctp for your error pages, then simply edit the error views and add the statement $this->layout = 'my_error' to the error400.ctp and error500.ctp.

So, I would like to use custom layouts for my error pages. Can someone show me the code examples of how can I do that?

Was it helpful?

Solution

Just write $this->layout = 'my_error' in your error400.ctp and error500.ctp files

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top