I have one custom function in .module file. Need to call that function .template file. Below is my code snnipet:
function non_login_preprocess_page(&$vars) { if(module_exists('test') && function_exists('test_get_rnd_data')){ $vars['rnd_data'] = test_get_rnd_data(); print_r("callled"); exit; } } the function exists does not return true. Is anything thing missing?
function_existsis a basic PHP method - if the file containing the function is included, which in the Drupal world equates to the module being enabled, there's no logical reason your code wouldn't work.