2
I’m reading the documentation from Smarty
but I still can’t understand how I can and can pass parameter to a template using the Smarty
.
I have this piece 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 body of this template.
Is there such a possibility?
Thanks @rray, great help again.
– adventistapr