我正在使用PHPOffice编写docx文件。这部分效果很好。但是,当我尝试使用此代码创建Writer保存为pdf或html时,出现奇怪的“找不到类'Zend \ Escaper \ Escaper'”。但是我根本不使用Zend。
$phpWord = \PhpOffice\PhpWord\IOFactory::load(JPATH_ROOT . '/images/powiadomienia/1.docx');
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
错误:
0 Class 'Zend\Escaper\Escaper' not found
Call stack
# Function Location
1 () JROOT/libraries/src/PhpOffice/PhpWord/Writer/HTML/Part/AbstractPart.php:41
2 PhpOffice\PhpWord\Writer\HTML\Part\AbstractPart->__construct() JROOT/libraries/src/PhpOffice/PhpWord/Writer/HTML.php:56
3 PhpOffice\PhpWord\Writer\HTML->__construct() JROOT/libraries/src/PhpOffice/PhpWord/IOFactory.php:44
4 PhpOffice\PhpWord\IOFactory::createWriter() JROOT/administrator/components/com_zawiadomienia/controllers/zawiadomienies.php:171
如果我使用的是PDF,HTML或其他任何Writer,它不会发生变化。 有人可以指出我在做什么错吗?