Skip to main content
added 18 characters in body
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Adding on to the answer given by Alex Gill

  1. .module files.module files are loaded on every load page, whereas .inc files.inc files are loaded only when they are requested.
  2. By convention .module files should contains only those functions which are implementation of hooks. Following this standard improves the performance tooimproves the performance too.
  3. .inc files can be included by mentioning the path in the hook_menuhook_menu(), or buby making an explicit using http://api.drupal.org/api/drupal/includes!module.inc/function/module_load_include/7('inc', 'node', 'node.admin') module_load_include('inc', 'node', 'node.admin');.
  4. If any of the .inc files contain any.inc files contains class objects, then it should be mentioned in the info.info file of the module.

Adding on to the answer given by Alex Gill

  1. .module files are loaded on every load page, whereas .inc files are loaded only when they are requested.
  2. By convention .module files should contains only those functions which are implementation of hooks. Following this standard improves the performance too.
  3. .inc files can be included by mentioning the path in the hook_menu or bu making an explicit using http://api.drupal.org/api/drupal/includes!module.inc/function/module_load_include/7 module_load_include('inc', 'node', 'node.admin');
  4. If the .inc files contain any class objects, then it should be mentioned in the info file of the module.

Adding on to the answer given by Alex Gill

  1. .module files are loaded on every load page, whereas .inc files are loaded only when they are requested.
  2. By convention .module files should contains only those functions which are implementation of hooks. Following this standard improves the performance too.
  3. .inc files can be included by mentioning the path in hook_menu(), or by making an explicit using module_load_include('inc', 'node', 'node.admin').
  4. If any of the .inc files contains class objects, it should be mentioned in the .info file of the module.
Source Link
Gokul N K
  • 6.7k
  • 4
  • 35
  • 58

Adding on to the answer given by Alex Gill

  1. .module files are loaded on every load page, whereas .inc files are loaded only when they are requested.
  2. By convention .module files should contains only those functions which are implementation of hooks. Following this standard improves the performance too.
  3. .inc files can be included by mentioning the path in the hook_menu or bu making an explicit using http://api.drupal.org/api/drupal/includes!module.inc/function/module_load_include/7 module_load_include('inc', 'node', 'node.admin');
  4. If the .inc files contain any class objects, then it should be mentioned in the info file of the module.