Include file inside hook_views_data()

Hello,

I need to use some field definitions, these definitions are located in 1 another repertory.

For this, i try to include this file inside the hook_views_data(), without sucess. The array of fields isn’t readed…

Here is my code:

/**
 * Implements hook_views_data().
 */
function mymodule_views_data() {
    
  // Define custom fields    
  module_load_include(‘php’, ‘mymodule’, ‘myfile’);

  // dpm($data) is always empty…

Can I call field definitions from a remote file? How can I resolve this problem?

Thanks for your suggestions.

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed