geoffs3310
geoffs3310

Reputation: 14008

cakePHP: I need to include a helper for when there is an error

I have made a helper class called Navigation that gets used on every page because it does stuff to my main navigation menu. So in order for this to work I have included the helper in my pages controller like so:

var $helpers = array('Html', 'Javascript', 'Navigation');

however when there is an error like a missing view or something the helper can't be found and I get a reference to a non-object error that messes my page layout up. I'm guessing this is becuase an error page uses a different controller, however there isn't a file error_controller.php or anything in the controllers file. So my question is where do I need to declare the helper so it can be found by an error page. Would I need to make an error controller file or is there already a file that I can add it in to?

Any help would be much appreciated

Thanks

Upvotes: 1

Views: 184

Answers (1)

deceze
deceze

Reputation: 522091

If it's used on every page, why not add it to the AppController?

Upvotes: 2

Related Questions