Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top