Skip to main content
added 85 characters in body
Source Link
user72672
user72672

First create a function that returns the variable. Then, something like this:

function my_function() {
return $var_name;
}

Then you must create a preprocess function, for the template, like this:

function MY_MODULE_preprocess_TEMPLATE(&$variables) {
  $V_NAME = my_function();
  $variables['v-name'] = $V_NAME;
}

Remember to clear the cache.

First create a function that returns the variable. Then you must create a preprocess function, for the template, like this:

function MY_MODULE_preprocess_TEMPLATE(&$variables) {
  $V_NAME = my_function();
  $variables['v-name'] = $V_NAME;
}

Remember to clear the cache.

First create a function that returns the variable, something like this:

function my_function() {
return $var_name;
}

Then you must create a preprocess function, for the template, like this:

function MY_MODULE_preprocess_TEMPLATE(&$variables) {
  $V_NAME = my_function();
  $variables['v-name'] = $V_NAME;
}

Remember to clear the cache.

Source Link
user72672
user72672

First create a function that returns the variable. Then you must create a preprocess function, for the template, like this:

function MY_MODULE_preprocess_TEMPLATE(&$variables) {
  $V_NAME = my_function();
  $variables['v-name'] = $V_NAME;
}

Remember to clear the cache.