Data injection in to file on openstack

This commit is contained in:
Marc Ducobu
2021-08-19 23:22:13 +02:00
parent 71e6b356c3
commit 0479ddb42b
2 changed files with 39 additions and 15 deletions

View File

@@ -68,14 +68,17 @@ class DocGeneratorTemplateController extends AbstractController
if ($template->getContext() == HouseholdMemberSelectionContext::class) {
$context = new HouseholdMemberSelectionContext();
// $datas = $context->getData($entity);
$datas = [];
$datas = $context->getData($entity);
} else {
throw new \Exception("Not implemented", 1);
}
$templateProcessor = new TemplateProcessor($tmpfname);
$templateProcessor->setValues(array('firstname' => 'John', 'lastname' => 'Doe'));
// TODO foreach ($datas['setValue'] as $key => $value) {
foreach ($datas['cloneRowAndSetValues'] as $cloneRowAndSetValues) {
$templateProcessor->cloneRowAndSetValues($cloneRowAndSetValues[0], $cloneRowAndSetValues[1]);
}
$tmpfname2 = tempnam(sys_get_temp_dir(), 'DOC_GENERATED');
$templateProcessor->saveAs($tmpfname2);