Symfony2 PHPWord response
问题 I am trying to generate a docx document on Symfony2, using the PHPWord bundle. In my controller, I succeed in returning a docx file, but it is empty, I think it comes from my faulty response format. public function indexAction($id) { $PHPWord = new PHPWord(); $section = $PHPWord->addSection(); $section->addText(htmlspecialchars( '"Learn from yesterday, live for today, hope for tomorrow. ' . 'The important thing is not to stop questioning." ' . '(Albert Einstein)' )); // Saving the document