In Cakephp we have some default error pages but we can create our own error page. Here we will create a custom error page to show error if controller not found. If controller not found then we will show 404 error page. Below are few steps for creating custom error page
First create a error.ctp file for layout if you want to show error page with different UI Open appController.php under /app/Controller and add the below code
- See more at: http://findnerd.com/list/view/How-to-create-a-custom-error-page/3470/
For any issue about PHP Programming Questions and Answers you can Visit to our PHP Developer Forum- function beforeRender() {
- $this->setErrorLayout();
- }
- function setErrorLayout() {
- if ($this->name == 'CakeError') {
- $this->layout = 'error';
- }
- }
No comments:
Post a Comment