Jump to content

no Hook constant in custom module controller


Recommended Posts

Hello:

There is a function called setMedia in controllers to add the JS or CSS you want (if that is what you need).

You must implement the hookHeader function in your module main file and register that hook on installl function to be executed.

I really don't understand yet what you mean with: " function Hook::exec() is not available "

Regards

Link to comment
Share on other sites

Thanks for your answers.

The problem is that Hook::exec('Header'), or Hook::exec('displayHeader') don't do anything in my custom front controller. I can't include other modules' CSS or JavaScript files.

And when I try to var_dump(Hook), I just get the string 'Hook' and when I try to see if the function exec() exists php says it doesn't.

I have two files where I can use Hook::exec(). One extends ModuleFrontController, and the other extends ProductPresentingFrontControllerCore, why can't I use the Hook constant?

As an example, the shopping cart doesn't work because it can't load its own JavaScript files...

Thanks in advance,

Edited by brainstormtrooper (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...