brainstormtrooper Posted November 3, 2018 Share Posted November 3, 2018 Hi, I have developed a module with a custom front controller and I need it to activate hooks, but the function Hook::exec() is not available. My front controller extends ModuleFrontController (if that helps...) Can anyone point me in the right direction? Thanks in advance :-) Link to comment Share on other sites More sharing options...
brainstormtrooper Posted November 10, 2018 Author Share Posted November 10, 2018 Thanks for your answer, I want to access displayHeader (HOOK_HEAD)... I need the modules in other hooks to be able to add their js and css files... Is that hook not available? I not, what do I need to use to access it? (and where can I find what hooks are available through which files?) Thanks in advance, Link to comment Share on other sites More sharing options...
Rolige Posted November 12, 2018 Share Posted November 12, 2018 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 More sharing options...
brainstormtrooper Posted November 17, 2018 Author Share Posted November 17, 2018 (edited) 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 November 17, 2018 by brainstormtrooper (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now