timmyraynor Posted July 8, 2013 Share Posted July 8, 2013 I am trying to read through Developer Guide for PrestaShop 1.5, in the hand book it gives an example of using hook in the controller: $this->context->smarty->assign('HOOK_LEFT_COLUMN', Module::hookExec('displayLeftColumn')); but in what scenario we need to use the hook in the controller is not well explained, could anyone explain a example for me? e.g. when using hook for modules, we could actually add page components. then when using hook for controllers..... Thanks Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Share Posted July 8, 2013 Hi, Not sure I understood your question. In the example, you're assigning the hook's content to the hook_left_column variable. WHen you place the variable somewhere in the template, all hooks hooked there will be displayed. If you only need to execute the hook (say, to perform an action)m you simply call hookExec Link to comment Share on other sites More sharing options...
vekia Posted July 8, 2013 Share Posted July 8, 2013 well, the most important thing in this case: what you exctly want to achieve? please clarify it Link to comment Share on other sites More sharing options...
timmyraynor Posted July 9, 2013 Author Share Posted July 9, 2013 well, the most important thing in this case: what you exctly want to achieve? please clarify it That's my question too, this code is copied from the Prestashop 1.5 Developer Guide, I just want to know what is the purpose for doing such hookexec Link to comment Share on other sites More sharing options...
PascalVG Posted August 24, 2013 Share Posted August 24, 2013 Hi timmy, did you get an answer already to this question? pascal Link to comment Share on other sites More sharing options...
Ricardo Vigatti Posted December 5, 2013 Share Posted December 5, 2013 (edited) I think that timmyraynor want to create a function on his controller that can be hooked by one of the existing prestashop hooks. Like we can do on modules, simply create a function "actionValidateOrder()", but now on controllers instead a module. Edited December 5, 2013 by Ricardo Vigatti (see edit history) Link to comment Share on other sites More sharing options...
axi Posted April 14, 2014 Share Posted April 14, 2014 I think that timmyraynor want to create a function on his controller that can be hooked by one of the existing prestashop hooks. Like we can do on modules, simply create a function "actionValidateOrder()", but now on controllers instead a module. Anyone succeed to do such a thing? 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