cakephp - How to put custom layout in 404 error page instead of default layout in cake php2.x -



cakephp - How to put custom layout in 404 error page instead of default layout in cake php2.x -

i have created error400.ctp in errors view. take default layout want alter custom layout

below code used won't work

public function error404() { $this->layout = 'customlayout'; // here user customlayout instead of default }

please suggest me how utilize custom layout

thanks sanjib

after doing lots of research solution

change exceptionrenderer in core.php utilize own renderer.

app/config/core.php:

configure::write('exception', array( 'handler' => 'errorhandler::handleexception', 'renderer' => 'myexceptionrenderer', 'log' => true ));

then create new file myexceptionrenderer.php

app/lib/error/myexceptionrenderer.php:

<?php app::uses('exceptionrenderer', 'error'); class myexceptionrenderer extends exceptionrenderer { protected function _outputmessage($template) { $this->controller->layout = 'innerdefault'; parent::_outputmessage($template); } } ?>

this works fine me, lets seek , share thought

cakephp

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -