[keyword] module development

Drupal7: on splitting module code into separate .inc include files

HOT TIP: this content is flagged as highly recommended !

Some key points about use of .inc files with Drupal7

Example of loading include file in same folder as the .module:

./includes/language.inc: *   module_load_include('language', 'inc', 'language.negotiation');
 
./includes/module.inc: *   module_load_include('inc', 'node', 'node.admin');
./includes/module.inc: *   module_load_include('inc', 'node', 'content_types');

Example of loading include file in a subfolder includes:

Drupal module development

This zone is not a complete guide to Drupal7 module development, it is mostly just a collection of links to useful existing material; you should in any case also inspect all of the examples under the Main Drupal7 API reference examples demonstrating the use of the main hooks.

Subscribe to RSS - module development