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
Post a Comment