简体   繁体   中英

how to include php file into drupal 7 custom module

I have module name is salesforce_auth

and I have created a folder name includes into my module and I have put my php file into includes folder name is PushToSlackRepository.php

and I have loaded my php file into my module like below:

 module_load_include('php', 'salesforce_auth', 'includes/PushToSlackRepository');

But its not loading my php file into my module. where I am doing wrong? I am new to drupal and need your help? Thanks in advance

  • Make sure your salesforce_auth module is installed and enabled.
  • Make sure where you have written the call to module_load_include and if it is called indeed?
  • Check the output of module_load_include to see if it returns TRUE or FALSE.
  • If it returns FALSE, run the lines of module_load_include one by one, to see which path it goes ending up with FALSE? This will give you a clue of the reason behind the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM