I just tried the second example using merge as needed to try and control the position of the documents using conditional statements. I get Fatal error: Call to a member function saveDocx() on null.
i'm sure there is something simple i am missing with this. is there a way to simply have conditional statements on each possible document (such as my example), merge as needed and the save that merged doc to the correct path? I can't seem to pass path parameters to saveDocx() and I'm not seeing any documentation for that.
it seems like you can only do the merge w/o a conditional and the saveDocX() doesn't work with the final merged document.
Also, even just copying the example and testing it gave a lot of errors about zip archive, null, etc. I don't know if we need to set something in our config/ini but we can't just merge on the fly it seems. There is always an error unless we use only one merge and then the process is complete - the doc gets created even if other objects were created and attempting to merge. You can only ever have one mergedocx it seems.
Thanks