gr4devel Posted May 20, 2013 Share Posted May 20, 2013 (edited) Hi community, in my never ending path to PS 1.5 I'm facing the need to adapt a module that previously was attached to a custom page and controller that I made. Now I've read that there is the possibility to put custom controller and page directly in the module directory (e.g. the bankwire module). However I still don't get how to call the module from the custom controller. Indeed, in the 1.4 version of my module I was using an hook. In particular I was using: a custom controller, a custom hook on which my module was attached, a template. All of these were handled by my module. The controller called the hook, my module displayed a template and at the same handled the interaction with the view previously displayed. Do I need to port all the logic in the new controller or can I leave the old hook of my module and directly call it from the template? For clarity the template displayed a registration form. Thanks in advance to everyone will try to help me. P.S: I apologize if I lack in clarity and so feel free to ask. Thanks again. Edited May 20, 2013 by gr4devel (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted May 20, 2013 Share Posted May 20, 2013 See here http://nemops.com/creating-new-pages-in-prestashop/ Or here: http://blog.arvixe.com/how-to-create-new-pages-in-prestashop/ Hope you can find it useful! Link to comment Share on other sites More sharing options...
gr4devel Posted May 20, 2013 Author Share Posted May 20, 2013 Wonderful Nemo1!!! I'll check these tutorial as soon as possible! I leave this topic open until I get all done! Thanks again!!! Link to comment Share on other sites More sharing options...
gr4devel Posted May 20, 2013 Author Share Posted May 20, 2013 (edited) Ok I've correctly setup the new page but the problem now is that I need to interact with my module (i.e. call what previously was done through the hook). Should I move all the logic previously present in the module in the new controller? If yes is it possible (I mean in a clean way) to access the module logic (i.e. variables and methods)? Edited May 20, 2013 by gr4devel (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted May 20, 2013 Share Posted May 20, 2013 Hi, You should be able to use your module this way $this->module Link to comment Share on other sites More sharing options...
gr4devel Posted May 20, 2013 Author Share Posted May 20, 2013 (edited) Yes Nemo1 you're right . But my problem was to call a module method as an action to a form submission (so from a tpl). However I resolved by calling the controller and put in its init method the call to the module method. That's the first thing that passed in my mind...it's the right way to do what I want? P.S: sorry for my unclarity...if something isn't clear ask without any problems Edited May 20, 2013 by gr4devel (see edit history) Link to comment Share on other sites More sharing options...
gr4devel Posted May 20, 2013 Author Share Posted May 20, 2013 If anyone has a better solution feel free to write it right down here. In the meanwhile I mark the topic as [sOLVED]. But before thank you very much @Nemo1!!! 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