I have this custom error handler:
`class AppError extends ErrorHandler {
function error404($params) {
$this->controller->layout = ‘public’;
$this->controller->set(‘title’,’Droptor Page Not Found’);
parent::error404($params);
}
}`
And I can’t seem to use any layout that has this:
$javascript->link('jquery',true)
So the JS helper isn’t loaded. But if I include this in the controller: var $helpers = array('javascript'); it still doesn’t work. Nor does App::import('Helper', 'javascript');
Crap, I didn’t read your question.
To add a helper to your error controller, just add this line:
There are two ways to do it:
First, you can create an app_controller to include every component and helper that you need on all your controllers.
Second, you can load the specific resources needed to your error controller. Create a file named
error.phpin your app’s root (NOT webroot) with the following code:You can also set a custom title with
Good luck.