Skip to main content
code fix
Source Link
Mołot
  • 21.9k
  • 8
  • 59
  • 112

The files directive is used to include files containing classes, check documentation. You could include the file in the .module file.

require_once __DIR__ . '/includes/blocks.inc';

Edit: Included the other solutions added by @Beebee and @Jimajamma in the answer:

require_once  drupal_get_path('module', 'mymodulename'mymodulename') . '/includes/blocks.inc';
module_load_include('inc', 'MY_MODULE', 'FILE_NAME');
// This method is including a file residing in the module folder not in a subdirectory.

The files directive is used to include files containing classes, check documentation. You could include the file in the .module file.

require_once __DIR__ . '/includes/blocks.inc';

Edit: Included the other solutions added by @Beebee and @Jimajamma in the answer:

require_once  drupal_get_path('module', 'mymodulename) . '/includes/blocks.inc';
module_load_include('inc', 'MY_MODULE', 'FILE_NAME');
// This method is including a file residing in the module folder not in a subdirectory.

The files directive is used to include files containing classes, check documentation. You could include the file in the .module file.

require_once __DIR__ . '/includes/blocks.inc';

Edit: Included the other solutions added by @Beebee and @Jimajamma in the answer:

require_once  drupal_get_path('module', 'mymodulename') . '/includes/blocks.inc';
module_load_include('inc', 'MY_MODULE', 'FILE_NAME');
// This method is including a file residing in the module folder not in a subdirectory.
improved answer by including suggestions added by @Beebee and @Jimajamma
Source Link
Sorin S.
  • 320
  • 1
  • 6

The files directive is used to include files containing classes, check documentation. You could include the file in the .module file.

require_once __DIR__ . '/includes/blocks.inc';

Edit: Included the other solutions added by @Beebee and @Jimajamma in the answer:

require_once  drupal_get_path('module', 'mymodulename) . '/includes/blocks.inc';
module_load_include('inc', 'MY_MODULE', 'FILE_NAME');
// This method is including a file residing in the module folder not in a subdirectory.

The files directive is used to include files containing classes, check documentation. You could include the file in the .module file.

require_once __DIR__ . '/includes/blocks.inc';

The files directive is used to include files containing classes, check documentation. You could include the file in the .module file.

require_once __DIR__ . '/includes/blocks.inc';

Edit: Included the other solutions added by @Beebee and @Jimajamma in the answer:

require_once  drupal_get_path('module', 'mymodulename) . '/includes/blocks.inc';
module_load_include('inc', 'MY_MODULE', 'FILE_NAME');
// This method is including a file residing in the module folder not in a subdirectory.
Source Link
Sorin S.
  • 320
  • 1
  • 6

The files directive is used to include files containing classes, check documentation. You could include the file in the .module file.

require_once __DIR__ . '/includes/blocks.inc';