I have a couple 开发者_JAVA技巧of custom PHP functions that I would like to make available to several modules I created.
What would be the drupal-correct way to get around this problem? Basically, I would like to avoid copying all those functions inside every module I have.
Well, you can't just copy the functions into every module because if you have two or more modules with those functions then you'll get PHP errors about the function already having been declared (unless you go through the effort of renaming them in each module).
The best way to go about it depends on your exact usage, but assuming they are a collection of related core or api functionality, then I would place these into a separate module and then any additional modules could have the core module as a dependency.
精彩评论