I want to create a folder name include in-side sites/all/custom/contrib/ and inside this want to write some .inc files like date.inc, string.inc in each file a class is created which holds function.

Now I want to use this functions in each module under sites/all/custom/contrib. I have 10 custom module so this .inc functions are available to each custom module.

What is the directory structure I have to follow and how can I achieve this?

  • 2
    create one custom module with all your functions, and enable it after you enable this module you can use those functions on other custom modules.
    – shrish
    Dec 29, 2015 at 7:29

1 Answer 1


In one of your custom modules, just create a directory includes and place your .inc files inside it.

To use the .inc files in your .module file, you can use module_load_include.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.