From the WHMCS development tutorial, I created a page success.
in the example code:
if ($ca->isLoggedIn()) {
$clientName = Capsule::table('tblclients')
->where('id', '=', $ca->getUserID())->pluck('firstname');
// 'pluck' was renamed within WHMCS 7.0. Replace it with 'value' instead.
// ->where('id', '=', $ca->getUserID())->value('firstname');
$ca->assign('clientname', $clientName);
}
You see, there assign the $ca->assign('clientname', $clientName);
.
But how can I get the variable clientname
in there? I tried use: $ca->clientname
and $clientname
, all not works.
You can access to this variable from your smarty template specified in the function $ca->setTemplate('mypage');
, for example /templates/default/mypage.tpl
:
Welcome, {$clientname}!
I don't have a final answer, but I can push you in the right direction use
var_dump($ca);
To see all properties $ca has. Maybe this will help you