PHPWord exampleのサンプル例に基づいて単語テンプレートを生成しようとしています。しかし、単語テンプレートが生成されていないか、ページを正常に表示できません。私は既にサンプル コードを除外しており、hello world のセクションを 1 つだけ追加しています。
Code:
<?php
require_once 'PHPWord.php';
$PHPWord = new PHPWord();
$section = $PHPWord->createSection();
$section->addText('Hello world!');
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=helloWorld.docx");
header("Content-Type: application/docx");
header("Content-Transfer-Encoding: binary");
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('helloWorld.docx');
?>
objwriter-> を使用する場合は、helloworld.docx を保存してください。それは自動的に私の Web サーバーに入れられますか? それとも一時フォルダ?
ありがとう!