Jump to content

Module for Custom functions


rizsti
 Share

Recommended Posts

I'm trying to create a module that will execute functions when a button is pressed. 

What would be the best way to implement this?  

The options I've considered are: 

  • Using a Process and creating a page in the admin section of the website;
  • Or perhaps creating a module and having a button on the settings page; 

There are probably other ways to do this that I haven't considered. I'd be open to suggestions.

Thanks for any help

Link to comment
Share on other sites

Do you need to add functionality anywhere in the core, does the button you press already exist? ;)

If so, you want use a hook that is executed when the button is pressed. Otherwise, if you want to add your own custom logic/forms/buttons,

you can use a Process Module.

Link to comment
Share on other sites

Do you need to add functionality anywhere in the core, does the button you press already exist? ;)

If so, you want use a hook that is executed when the button is pressed. Otherwise, if you want to add your own custom logic/forms/buttons,

you can use a Process Module.

No, I don't need to add any core functionality and the button doesn't exist.  

I just want to create buttons with functions attached.  Which hooks should I be looking into?

This is sort of what I'm looking for (or a better way to do essentially this): 

3DU4fXql.png

Link to comment
Share on other sites

Modules can have configurations where you have the buttons. This is already there if you implement the configurable interface. You add them and check for them via input name. There's many modules that have this already so you should study them. Also a possibility is to create a custom admin page using a process module so you have your own screen to add forms and buttons and do whatever you like with using api. ProcessHello is a example of such a module.

  • Like 1
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
 Share

×
×
  • Create New...