Custom hook
I want to create custom hook which can be used by different modules. What are the steps and best possible way to create custom hooks?
(3 votes)
- Login or register to post comments
- 2625 reads
-
Your feedback


Recent comments
- I have contributed a module
20 weeks 6 days ago - Improved Image menu
39 weeks 3 days ago - Great code!
41 weeks 1 day ago - Code Search is ready
50 weeks 4 days ago - I would love to see an
1 year 2 weeks ago - Thank you very much for your
1 year 3 weeks ago - Commented code
1 year 3 weeks ago - We are glad to know that the
1 year 3 weeks ago - Enhancements to codes
1 year 3 weeks ago - We have developed a module
1 year 4 weeks ago



To create/offer custom Drupal hook, you must implement in a ways such that calling the hook with module_invoke or module_invoke_all does not make any conflicts with other module hooks. The name of the hook should be unique and it should offer all/specific feature in such a general way that it doesn't require any type of adjustments with code. All the configuration must go on admin pages and should store those configurations in a separate table or any existing tables create by Drupal or modules on which your modules depends. The hook should be easy to implment by other modules and it should not be much complex to implement. When you create custom hooks, your module(s) act(s) as API provider.
Let me know if this can help you. Feel free to drop in a line at any time.
Regards.
[url=http://twitter.com/DrupalD][i]Drupa Developer - A Comprehensive Guild to Drupal Developersl[/i][/url]
Thanks for your information. That will do.
Regards