[keyword] .inc

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:

Subscribe to RSS - .inc