Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
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 '12 at 18:24
add comment

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().

share|improve this answer
    
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 '12 at 18:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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