0

I wanted to use apachesolr module along with a field module that is custom written.

The field module gives the input to 'apachesolr' module instead of the normal search bar. The output is passed through the field module. The output is printed as the field output.

Will module_invoke() be helpful in these cases?

I want to pass variables from one module to another module like the input and output.

2 Answers 2

1

As alternative, you can use also drupal_static() if the value you pass from a module to the other doesn't need to be saved past the page request. When both the modules pass to drupal_static() the same value for the first parameter, they get the same static value.

In the case you use drupal_static(), you must be sure the module that is setting the static variable is executed before the module that reads that value.

1
  • Hi, i have came to know that the api has a module. I have posted my question in more detail here drupal.org/node/1711908, if you would like to take a look. Thank you for the reply :)
    – kich
    Aug 6, 2012 at 18:24
0

According to the API, module_invoke() seems to do the job if you plan on passing the data as arguments to a hook the specified module. If you just want another module to have access to the variables, you can always use variable_set() and variable_get().

1
  • Hi, i have came to know that the api has a module. I have posted my question in more detail here drupal.org/node/1711908, if you would like to take a look. Thank you for the reply :)
    – kich
    Aug 6, 2012 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.