Please, tell me where I can place my own PHP function? I want to use them for my snippets. Thank you
Create a directory for a module: eg /sites/all/modules/goodboy
Put a goodboy.module file in there containing your PHP functions eg:
<?php function goodboy_function_1() { // do something return $something; } function goodboy_function_2() { // do something else return $something_else; } ?>
Note: start the names of your functions with the name of your module to avoid naming conflicts with other code.
Create a goodboy.info file in the directory for the module eg:
name = Goodboy description = "Goodboy's utility module."
Now once you've enabled that module, you should be able to use those functions anywhere in Drupal.
More details: http://drupal.org/node/508
-- Anton New to Drupal? | Troubleshooting FAQ Example knowledge base built with Drupal
Thanks advance! I've made my first module. I'm happy :)
Comments
create a module - it's not that scary
Create a directory for a module: eg /sites/all/modules/goodboy
Put a goodboy.module file in there containing your PHP functions eg:
Note: start the names of your functions with the name of your module to avoid naming conflicts with other code.
Create a goodboy.info file in the directory for the module eg:
Now once you've enabled that module, you should be able to use those functions anywhere in Drupal.
More details:
http://drupal.org/node/508
--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal
Thanks advance! I've made my
Thanks advance! I've made my first module. I'm happy :)