PHPWord has an excellent template example but I checked its code and it saves the file locally (taken from ../Examples/Template.php
):
$document = $PHPWord->loadTemplate('Template.docx');
...
$document->save('Solarsystem.docx');
Compared to one who uses the createWriter
method which has an option to auto-download:
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('php://output');
Is auto-download possible for templates? (see PHPWord/Template.php::save
)
I do not want it to be saved locally to remove the task of creating a garbage collection when an auto-download option available.