[drupal-devel] Inter-module function calls
Can someone tell me what the best way is for me to invoke functions from an existing module when writing a new module? For example, "taxonomy_get_vocabularies" from the taxonomy module works fine if I call it directly from within a new module I'm writing, but is it kosher to do this? Should I be using module_invoke instead? -- -------------------------------- | Sheldon Rampton | Research director, Center for Media & Democracy (www.prwatch.org) | Author of books including: | Friends In Deed: The Story of US-Nicaragua Sister Cities | Toxic Sludge Is Good For You | Mad Cow USA | Trust Us, We're Experts | Weapons of Mass Deception | Banana Republicans -------------------------------- | Subscribe to our free weekly list serve by visiting: | http://www.prwatch.org/cmd/subscribe_sotd.html | | Donate now to support independent, public interest reporting: | https://secure.groundspring.org/dn/index.php?id=1118 --------------------------------
Sheldon Rampton wrote:
Can someone tell me what the best way is for me to invoke functions from an existing module when writing a new module? For example, "taxonomy_get_vocabularies" from the taxonomy module works fine if I call it directly from within a new module I'm writing, but is it kosher to do this? Should I be using module_invoke instead?
yes, use module_invoke. Your call will not return anything if the target module is not enabled.
participants (2)
-
Moshe Weitzman -
Sheldon Rampton