Hi guys, I'm kind of stuck...
In my app I have a setting, stored in db, which is responsible for
disabling the app and showing the 'under maintenance' message. I store
the value of that in a constant called TECHNICAL_DOWN_FOR_MAINTENANCE.
So in my AppController::beforeFilter() I have:
//Checking if not maintenance time...
if (TECHNICAL_DOWN_FOR_MAINTENANCE) {
$this->cakeError('maintenance');
return;
}
And here is my AppError in app/error.php:
<?php
class AppError extends ErrorHandler {
/**
* Outputs information on maintenance break
*
* @param array $params
*/
function maintenance($params) {
$this->controller->layout = 'maintenance';
$this->__outputMessage('maintenance');
}
}
As you can see, I use layout of 'maintenance.ctp' and the view with
same name. Therefore I have created respectively app/views/layouts/
maintenance.ctp and app/views/errors/maintenance.ctp. And everything
works perfectly, ie. maintenance.ctp layout is used, when I have debug
setting set to 1 or 2. When I set it to 0, cake switches to default
layout and displays the 404 message. Unfortunatelly the Error Handling
part of Cookbook is still missing, so I hope you have some clues what
may help here.
Cake 1.2.0.7296 RC2
Regards,
Piotr
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---