TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

Create 2 documents from 1 set of data

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Alex Nicol
Date: 2013-04-24
Time: 15:55

Create 2 documents from 1 set of data

Thanks for the plug-in and setup instructions.

I am trying to create 2 documents.  1 that goes to the client and 1 that is stored in our offices.  Information is gleaned into a html form.  I am able to merge it into 1 document no problems at all.  How do I essentially close the $TBP and then start it again with a different template?

Many Thanks

Alex
By: Sarah
Date: 2013-04-24
Time: 17:50

Re: Create 2 documents from 1 set of data

My guess would be: do the internal version first and use $TBS->Show(OPENTBS_FILE, $file_name); to save the created file to a server location, then load the external template and use $TBS->Show(OPENTBS_DOWNLOAD, $file_name); to give the file to the user.
By: Alex Nicol
Date: 2013-04-24
Time: 18:51

Re: Create 2 documents from 1 set of data

I tried that, but it ended up not doing either.

Got round it by making it a separate page.

The next question that I know is coming my way is: "Can we automate the emailing of the file to the client?" i.e can I generate the files and the email them in the same script?
By: Sarah
Date: 2013-04-24
Time: 18:55

Re: Create 2 documents from 1 set of data

If you choose the option to save the file to a server location you can do whatever you want with it later in the script. Just keep track of the path you save to and add whatever emailing info you need then use the path for adding the attachment.