Hello,

I'm trying to change the layout based on the admin routing param
within a custom 404 error function in app_error.php.

1. I can check for the existence of the admin routing param. It is
available via $this->controller->params['admin']
2. Can change it, for example: $this->controller->layout =
'admin.default';

Problem is the normal layout get's rendered. Any suggestion how to
implement this?

Code sample:

class AppError extends ErrorHandler
{
   function error404()
   {

      ....

      if(array_key_exists('admin',$this->controller->params) && $this-
>controller->params['admin'] == TRUE)
      {
           $this->controller->layout = 'admin.default';
      }

      ...

   }
}

//check...
print_r($this->controller);

Thanks!
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to