drupal - call a function in a hook -
i have created custom module 'sample'.i have created 'user_login' hook.i want call function 'calltype' within user_login hook function not called.cookie created if write calltype function code after line $anivpopup = '1'; in user_login hook
function sample_user_login(&$edit, $account){ $anivpopup = '1'; calltype(); } function calltype(){ $anivpopup =1; if($anivpopup == '1'){ setcookie('test', '2', time()+3600); //cookie set 1 hr } }
try :
function sample_user_login(&$edit, $account){ if(function_exists('calltype'){ calltype(); }else{ die('function calltype not declared'); } } you must know , drupal hook implementation in cache , on every modification made you have clear registry cache
Comments
Post a Comment