Merge remote-tracking branch 'origin/master' into integrate_wopi_bundle

This commit is contained in:
2021-08-20 11:05:42 +02:00
4 changed files with 43 additions and 17 deletions

View File

@@ -70,14 +70,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);