0
votes

I have an ItemsController which extends AppController. To handle my site menu, I used a menuhelper. However, I saw in the documentation that you have to add your helpers in an array in your controller (AppController):

public $helpers = array('Form', 'Html', 'Menu');

The weird thing is that I forgot it and my menu worked anyway. Also, you always have to add Form and Html extra to the array because otherwise they don't work anymore. However, when I do something like this in my AppController, my form helpers still work:

public $helpers = array('Menu');

So it seems that whatever I do, it still works, but I don't get why and I don't like automatic "magic" :)

Is there something I am missing in the docs?

1
show how you are using these helpers? - Anubhav
Well, in an add view I use "$this->Form->create('something')" which works, for the menu plugin, I call "$this->Menu->render($menu)" in my default layout, which also works. - randomizer

1 Answers

1
votes

Since 2.x you don't "need" to specify app or core helpers. Those are lazyloaded automatically.

You only need to specify plugin helpers manually.

That said I personally still always describe what helpers I use, just to be consistent with the plugin ones.