Hi,
We have the Enterprise version 5.1. I'm wondering if you can have variables for the documents so that you either pull them in or don't if they don't exist? If I have a possible maximum of 3 documents, but I can have anywhere between only 1 of those to all 3, is there some special conditional logic we can use? I can test for which are not empty, but does that mean multiple options for every possible scenario or can it just skip any file it doesn't find? I have the following rough example. Thank you.
//doc #1 (optional)
if (!empty($doc_one)) {
$docx = new CreateDocxFromTemplate($doc_path.$doc1.'.docx');
$docx->setTemplateSymbol('^');
$variables = array(~~~~~);
$doconefilename = 'doc1-'.time();
$docx->replaceVariableByText($variables);
$docx->createDocx($temp_path.$doconefilename); // create file
// doc #2 required
// main template
$docx = new CreateDocxFromTemplate($path.'doc2.docx');
$docx->setTemplateSymbol('^');
$variables = array(~~~~~);
$templatefilename = 'doc2-'.time();
$options = array('parseLineBreaks' => true);
$docx->replaceVariableByText($variables, $options);
$docx->createDocx($temp_path.$templatefilename); // create file
// merge if multiple
if (!empty($doc_one)) {
$merge = new MultiMerge();
$merge->mergeDocx($temp_path.$affidavitfilename.'.docx', array($temp_path.$templatefilename.'.docx'), $final_path.$final_file.'.docx', array());