Victor Lugo Posted March 30, 2010 Share Posted March 30, 2010 Hi, If anyone here can tell me how to access the smarty $template value (also the same as the &systpl= value) via an action hook, I'd appreciate it. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
HerrZ Posted March 30, 2010 Share Posted March 30, 2010 smarty values in hooks you can access by the following: global $smarty; echo "<pre>_tpl_vars: " . print_r($smarty->_tpl_vars,TRUE) . "</pre>"; // assign like this #$smarty->assign('thevarname', $thevarphpvalue); template var is in $smarty->_tpl_vars['template'] // i think 0 Quote Link to comment Share on other sites More sharing options...
Victor Lugo Posted March 30, 2010 Author Share Posted March 30, 2010 I tried the above on an action hook and the output is simply: <pre>_tpl_vars: </pre> With _tpl_vars['template'] no output is generated, which would indicate null values... any ideas? 0 Quote Link to comment Share on other sites More sharing options...
HerrZ Posted March 31, 2010 Share Posted March 31, 2010 ok, try this hole sample: // this code in a .php file in "<whmcs_root>/includes/hooks" folder function init_ClientAreaPage() { global $smarty; echo "<pre>_tpl_vars: " . print_r($smarty->_tpl_vars,TRUE) . "</pre>"; } add_hook("ClientAreaPage",1,"init_ClientAreaPage",""); using the hook ClientAreaPage . the hook runs on every page at very last moment before page is rendered. 0 Quote Link to comment Share on other sites More sharing options...
Victor Lugo Posted April 3, 2010 Author Share Posted April 3, 2010 HerrZ, Thank you very much, that is exactly what I needed. Going to open another thread, but if you know anything about hooks before e-mail templates are sent but after smarty variables are set, let me know. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
danami Posted March 13, 2013 Share Posted March 13, 2013 Sorry wrong thread. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.