Jump to content

[SOLVED] New page handled by a module


gr4devel

Recommended Posts

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 by gr4devel (see edit history)
Link to comment
Share on other sites

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 by gr4devel (see edit history)
Link to comment
Share on other sites

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 by gr4devel (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...