I'm reading the documentation for Smarty
but I still can not understand how I can and can pass parameter to a template using Smarty
.
I have this snippet of code:
if ($part == PagePart::RecordCard && ($mode == PageMode::View || $mode === PageMode::ExportPdf)) {
$cpf = GetApplication()->GetGETValue('pk0');
$sql = "SELECT Opcao FROM dvsDecModelo WHERE CPF = '$cpf' ";
$Opcao = $this->GetConnection()->ExecScalarSQL($sql);
if ($Opcao == "Contrato") {
$result = $mode === PageMode::ExportPdf ? 'TempModelo1Pdf.tpl' : '';
} elseif($Opcao == "Adesão") {
$result = $mode === PageMode::ExportPdf ? 'TempModelo2Pdf.tpl' : '';
} else {
$result = $mode === PageMode::ExportPdf ? 'TempModelo2Pdf.tpl' : '';
}
}
Now, in my case, I need to pass the result of a query to the template, retrieve it and use it in the template body.
Is there a possibility?