FEU, passing smarty variables, UDT
Posted: Fri Nov 20, 2009 10:30 pm
Having an issue with FEU Module, perhaps I am really having a PHP/Smarty issue, would appreciate some kind reflection ...
I have an enrollment form that upon submit calls index.php?mact=FrontEndUsers,cntnt01,do_adduser,1
In modules\FrontEndUsers\action.do_adduser.php I added the following line to set the smarty variable with the input transferred from the user submitted form:
$smarty->assign('feu_user', $params['feu_input_username']);
Now where it gets interesting, I pass control forward to another page, which collects some credit card information and attempts to transmit information to the credit card processor, but I need a bunch of variables from FEU database, and create a transaction hash that I have to pass with the data, so I do it all in a UDT (I never wanted to edit the action.do_adduser.php but did so as a last resort) ... so my UDT follows:
global $gCms;
$smarty = &$gCms->GetSmarty();
$username = $smarty->get_template_vars('feu_user');
echo ('got the user name' . $username);
$feusers = $gCms->modules['FrontEndUsers']['object'];
$uid = $feusers->GetUserID($username);
$properties = $feusers->GetUserProperties($uid);
foreach($properties as $key=>$value) {
if ($value["title"] == "country") {
$country = $value["data"];
}
if ($value["title"] == "Payment_Cycle") {
$batchday = $value["data"];
}
if ($value["title"] == "firstname") {
$first_name = $value["data"];
}
if ($value["title"] == "lastname") {
$last_name = $value["data"];
}
}
But, my echo is blank, and obviously my $feusers->GetUserProperties($uid) blows up ...
So any thoughts as to why when I try to get the $smarty variable that I set in the PHP that its blank?
Thanks
Doug
I have an enrollment form that upon submit calls index.php?mact=FrontEndUsers,cntnt01,do_adduser,1
In modules\FrontEndUsers\action.do_adduser.php I added the following line to set the smarty variable with the input transferred from the user submitted form:
$smarty->assign('feu_user', $params['feu_input_username']);
Now where it gets interesting, I pass control forward to another page, which collects some credit card information and attempts to transmit information to the credit card processor, but I need a bunch of variables from FEU database, and create a transaction hash that I have to pass with the data, so I do it all in a UDT (I never wanted to edit the action.do_adduser.php but did so as a last resort) ... so my UDT follows:
global $gCms;
$smarty = &$gCms->GetSmarty();
$username = $smarty->get_template_vars('feu_user');
echo ('got the user name' . $username);
$feusers = $gCms->modules['FrontEndUsers']['object'];
$uid = $feusers->GetUserID($username);
$properties = $feusers->GetUserProperties($uid);
foreach($properties as $key=>$value) {
if ($value["title"] == "country") {
$country = $value["data"];
}
if ($value["title"] == "Payment_Cycle") {
$batchday = $value["data"];
}
if ($value["title"] == "firstname") {
$first_name = $value["data"];
}
if ($value["title"] == "lastname") {
$last_name = $value["data"];
}
}
But, my echo is blank, and obviously my $feusers->GetUserProperties($uid) blows up ...
So any thoughts as to why when I try to get the $smarty variable that I set in the PHP that its blank?
Thanks
Doug